forked from dwr-psandhu/ann_calsim
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfnet_CCFB.f90
183 lines (181 loc) · 13.5 KB
/
fnet_CCFB.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
module fnet_CCFB
! a = 0.00088789
! b = -0.053594
intrinsic Reshape
real, dimension(8,126) :: input = &
Reshape((/-0.00236344,0.10339987,-0.19946644,0.2139483,-0.030128961,0.15317921,0.016348833,0.09222416,&
0.09359648,-0.090866,-0.0773873,0.0874523,0.09961418,0.03436028,0.05392377,0.01877275,&
0.007451453,0.055440195,0.085436,-0.07744798,-0.07414683,-0.10617603,0.06515189,-0.034436334,&
-0.21735199,0.005648271,-0.08199749,0.05902164,-0.10644491,-0.05480073,-0.012551692,0.03125256,&
-0.2675608,-0.006460821,-0.055492967,-0.034806814,-0.2664096,-0.09985002,0.015030344,0.15517478,&
-0.08010302,-0.049725417,-0.033756096,0.034489647,0.08470103,-0.2226404,-0.06721579,-0.10870146,&
-0.036375836,0.0871214,0.17113218,-0.1763174,-0.117469884,-0.020566396,0.041496284,0.08452252,&
-0.16110584,0.07794019,0.002176553,0.13813278,-0.1771196,0.16651447,0.103733175,0.23217386,&
-0.16165793,-0.28960246,-0.3361225,-0.2517249,0.18911555,1.6502348,-0.05626993,0.3179317,&
-0.07481152,-0.17747408,0.096303776,-0.37011018,0.4546728,0.68600976,-0.34253868,0.30303872,&
-0.40076163,-0.13628483,0.19002815,-0.6439374,0.030472638,0.31475478,-0.13806236,-0.17304637,&
-0.38605264,-0.24112509,0.005873262,0.13364229,-0.2162053,-0.29045135,0.002501905,0.12139273,&
-0.1282765,-0.20189473,-0.16811125,0.33388725,-0.010830322,0.026138447,-0.039676268,0.5304634,&
-0.03477089,0.12465108,0.01454509,0.13737732,-0.098021254,0.104838915,0.10226043,0.14409584,&
-0.10242274,-0.13738714,0.08946471,0.48644817,0.32381794,0.07838552,0.09103071,0.18849401,&
-0.10636498,-0.33583817,0.17965864,-0.055378962,0.17445664,-0.04623155,-0.10036243,0.32018617,&
-0.009779724,-0.34214112,0.33807617,-0.049013335,0.43279484,-0.57848364,-0.26098356,0.29825568,&
-0.13887155,0.06535787,-0.14035502,0.078441754,0.14488617,-0.14198528,-0.15033056,-0.22832674,&
-0.01442674,0.09344133,0.027764518,0.08318142,0.12136384,-0.004614071,-0.030171221,-0.021402849,&
0.12496892,-0.005403914,0.19589421,-0.12760815,0.2763262,-0.15594837,0.10008255,-0.08914311,&
0.034587294,-0.036013573,0.10535003,-0.12594125,-0.023874031,0.025651466,0.058972836,0.30653107,&
0.16317329,-0.030473368,-0.102153026,-0.08569405,0.20810921,0.36173433,0.121703655,-0.08810835,&
-0.16920866,0.07843541,0.030913064,-0.007608146,-0.028445737,0.18810081,0.23933461,0.13556537,&
-0.09766405,0.16624537,-0.2140117,0.034743536,0.12691583,0.15729403,0.019241944,0.12652391,&
-0.16633466,0.1002079,-0.040371027,-0.11207502,0.10209097,-0.0100681,0.08391176,0.12318336,&
-0.30412567,0.065810405,-0.21928485,-0.19665387,0.20659678,0.03320436,-0.010293609,0.122016236,&
-0.40754429,-0.019674797,-0.3251074,-0.1810008,0.067545064,-0.5380319,0.30135205,0.001997189,&
-0.45239475,0.26377413,-0.43086225,-0.22055121,0.069519244,0.03863388,0.19293438,0.14591962,&
-0.39654782,0.19581632,0.007900119,-0.1724248,-0.13878587,-0.5058172,0.3039624,0.043340076,&
-0.044235054,-0.034336705,-0.39633957,-0.2885356,0.16504313,0.24770336,-0.051472563,-0.08335006,&
0.06568389,0.14554387,-0.21736638,0.09287693,0.05953467,0.7019397,0.12194776,0.044880383,&
0.31720045,0.47449696,-0.06063993,0.3640679,0.098240666,-0.055430986,0.03710428,0.14950038,&
0.37456596,0.1876326,-0.045073748,0.29128993,0.12374082,0.36418632,0.31384692,-0.24387214,&
0.8840982,0.47753125,-0.12143088,0.32201692,0.06696981,-0.025421534,0.2859319,-0.28615373,&
0.37560305,0.5171175,-0.37931985,-0.02862479,0.20040537,-0.18815477,-0.22128955,-0.55360335,&
0.99222296,0.48813787,-0.72096103,0.278486,0.16389826,1.1023599,-0.12947634,0.12962343,&
2.5306838,-2.5137768,1.8340473,1.9144781,-2.0094142,1.5760306,-1.765861,-1.8029583,&
2.3107388,-2.2303047,1.7060641,1.7979109,-1.8286315,1.7436569,-1.6585349,-2.1178582,&
2.3047595,-2.4188578,1.4125698,1.668164,-1.5753179,1.7051647,-1.5374223,-1.6757679,&
2.1569922,-2.0868452,1.5939822,1.6115712,-1.7076018,1.5033834,-1.8684558,-1.8535912,&
2.2155056,-2.1724257,1.6537081,1.692557,-1.5946708,1.7578201,-1.6668782,-1.7759053,&
2.188301,-2.378962,1.6407508,1.6644975,-1.4578569,1.9609058,-2.0136445,-1.8271978,&
2.2603765,-2.548659,1.9812533,2.1069255,-1.9186785,1.9536012,-2.2764387,-2.1993155,&
2.6083066,-2.401914,2.251035,2.295505,-1.9255297,2.125932,-2.4392095,-2.12378,&
3.9191577,-3.7937317,3.9610615,3.8448327,-3.7473462,3.9886606,-3.9752052,-3.6462,&
4.2792964,-3.8764992,3.7952867,3.6548827,-3.6707444,3.2631044,-3.674269,-3.6795611,&
3.5265746,-4.043685,3.0253024,2.481687,-3.1889257,1.9339372,-2.7295275,-3.126525,&
2.2792792,-2.8821046,1.0943778,0.7502207,-1.9754497,0.699501,-0.9470931,-1.7241651,&
1.3834513,-1.9404261,0.52334553,0.43162608,-1.3846797,0.547391,-0.34357005,-1.0171018,&
0.8777956,-0.9405254,0.5569404,0.18435809,-1.1878648,0.49194607,0.2189303,-0.6373193,&
0.3626319,-0.17128822,0.1830947,-0.09421582,-0.6111866,0.24435435,0.32595438,-0.3946591,&
0.3099984,-0.11182595,0.07950002,-0.16791713,-0.7992357,0.24714908,0.124325626,-0.57464224,&
0.22034411,-0.08330455,-0.07207798,-0.16962838,-0.65141946,0.12656765,-0.06403358,-0.53752995,&
0.19733053,0.079003625,-0.3406645,0.059709825,-0.12904827,0.005446377,-0.081919886,0.103291504,&
0.16929857,-0.2356051,0.26243675,0.1556946,-0.423301,-0.3027194,-0.5033762,-0.47744986,&
0.4652316,-0.056175712,0.5150304,0.38141757,-0.15910992,-0.36515272,-0.25000256,-0.4995772,&
0.48506984,-0.11898588,0.27264756,0.27702114,-0.31099108,-0.3982596,-0.28190872,-0.6406564,&
0.34626102,-0.093220904,0.31348056,0.404192,-0.20633142,-0.16514547,-0.2932096,-0.40224236,&
0.25360548,-0.26408088,0.42093226,0.5152425,-0.1466497,-0.23287243,-0.6881754,-0.6781682,&
0.29835746,-0.27297845,0.51322085,0.5174195,-0.3331047,-0.24715607,-0.5025619,-0.6831577,&
0.09890511,0.002683509,0.35963416,0.2630991,-0.3759263,-0.2660143,-0.681874,-0.5491964,&
0.10279717,0.16611412,0.5221198,0.21534659,-0.43782657,-0.18189447,-0.4901296,-0.4215754,&
0.2817885,0.06213689,0.43206173,0.31557465,-0.25882053,-0.53708094,-0.7307085,-0.2755025,&
0.6270112,-0.21695979,0.48139068,0.35056177,-0.54508513,-0.06695694,-0.5757602,-0.4901209,&
0.6181077,-0.58760303,0.48667297,0.19827336,-0.61463416,-0.04903373,-0.4886377,-0.44503585,&
0.7632886,-0.7636473,0.6624032,-0.037099738,-0.26804107,-0.13567692,-0.27576426,-0.8177189,&
0.44476232,-0.8958246,0.59184223,-0.12729779,-0.36502188,-0.28524822,0.15307415,-0.5152308,&
0.30985677,-0.39475164,0.36161718,-0.24134007,0.14910367,-0.5149953,0.19085175,-0.1567511,&
0.001605869,0.20878042,0.07979294,-4.84E-05,0.20571882,-0.45589942,0.084047034,-0.12319093,&
0.12200497,-0.05068205,0.5856467,0.40174484,0.10194022,-0.002039602,-0.07179066,-0.25520617,&
-0.04738106,0.28811628,-0.15231165,0.14765374,0.1808647,-0.14874569,0.1249951,-0.23987162,&
-0.10125919,-0.10578914,-0.08274714,0.85696137,0.22281481,-0.3796342,0.001377331,-0.05833635,&
-0.60059404,-0.1265565,-0.3169559,-0.25667456,0.30851603,-0.16404442,-0.034509037,-0.28704482,&
-0.20661049,-0.1986763,-0.035231862,-0.22811061,0.08483349,-0.006105488,0.002364291,-0.1817031,&
-0.22722022,-0.054092452,-0.18629506,0.069654174,0.03796409,0.0703884,-0.09676529,0.12457669,&
0.07388387,-0.07228881,0.17312975,-0.20448782,0.04011011,0.29056042,0.12695512,-0.05237201,&
-0.11473037,-0.09519352,-0.12494954,-0.030280184,-0.012208074,0.21383907,-0.047950827,0.112527944,&
-0.018642366,0.034889124,0.09196731,0.21530963,0.052757535,0.11190657,0.052976884,0.054622307,&
-0.08767189,0.025924582,-0.13071418,-0.013999212,-0.16109999,0.003037516,-0.017328782,-0.031623688,&
-0.11085035,-0.016678503,-0.093103155,0.057135336,0.01669221,-0.14481203,-0.1808625,-0.2936877,&
-0.36229,0.33577782,-0.5621701,-0.25120902,0.2527435,-0.10239568,-0.10369535,-0.43480334,&
0.11116089,-0.32878855,-0.16645275,0.13231093,-0.4764987,0.5042783,-0.29004404,-0.9673621,&
-0.118346035,0.15287039,-0.30081287,-0.29295427,0.39804813,-0.18951482,0.30507892,0.056167614,&
0.020816054,-0.1633952,-0.099948935,-0.07091471,-0.014524182,0.7984392,0.21278074,-0.2766323,&
-0.21512866,-0.5073032,-0.2854876,-0.49121863,-0.1005228,0.21100977,0.25627166,-0.2525175,&
0.06448984,-0.20490262,-0.16364211,-0.1046463,-0.2143394,0.46760482,-0.12667437,-0.8017543,&
-0.35494378,0.74067014,-0.28156343,-0.20080543,0.21479923,0.18640843,0.27629244,0.15000889,&
0.16839997,-0.08438318,0.23438929,0.10707764,-0.28851333,0.19184761,-0.37907696,0.44331592,&
-0.24802852,0.20294586,-0.14600103,0.12129452,0.028898356,0.056004427,-0.3652415,-0.47537068,&
-0.37674433,0.09383255,0.11148196,-6.74E-05,-0.012779229,0.059724625,-0.19113155,-0.15571202,&
0.20512073,0.11113957,0.06708543,0.08288009,-0.21866885,0.086522296,0.1846239,0.026750436,&
-0.17622072,0.018491773,-0.057130624,0.014872224,0.019293852,-0.035424374,0.109963864,-0.1438554,&
-0.17747065,0.15217085,-0.000527877,0.001081419,-0.23287585,-0.12411174,0.13005817,0.012050144,&
-0.17272219,0.000973817,-0.098044805,0.1181601,0.01708767,-0.010291809,-0.0547876,0.065528266,&
-0.0760001,0.023663733,0.11590955,-0.25932828,-0.06428005,-0.053278513,0.022271387,0.015646027,&
0.09555977,0.25573045,-0.17069635,0.028693076,-0.06956371,-0.04862527,-0.031145038,-0.010797726,&
-0.07336765,0.1478503,0.20959215,-0.09495825,-0.14590739,0.02724469,0.14545624,0.2614123,&
-0.20940952,0.3059672,-0.09422866,-0.17164539,-0.07141295,0.03191836,-0.028355902,0.21046008,&
-0.17751333,0.45460585,-0.4254678,-0.17860124,0.28624994,-0.41797474,0.2570829,0.29901794,&
-0.41930744,0.4256426,-0.1562944,-0.052444547,0.077983215,-0.20870574,0.06312737,0.19904956,&
-0.28074414,0.16698217,-0.06976343,0.024023527,-0.024785314,0.32921988,0.17199253,-0.07005899,&
-0.27353197,0.33337036,-0.17478774,0.08341359,0.026830114,0.3169856,0.07641513,0.07015027,&
0.05238899,0.19302407,-0.035508227,0.33653697,0.07100623,0.16481052,0.15743473,0.2759572,&
0.3195525,-0.11194229,0.39692384,0.007192729,-0.15049888,-0.19634081,-0.1324198,-0.024663452,&
-0.19223022,0.30867505,-0.056041017,0.08788658,0.4263214,-0.6132586,0.27089068,0.34956753,&
0.035883855,0.033898648,0.61225116,0.26029283,-0.09014357,-0.66895264,-0.20102581,-0.21915647,&
-0.30680493,0.11972783,0.13825347,-0.11848718,-0.071441755,-1.0828997,-0.061145272,0.08370388,&
-0.4023025,0.3644405,0.09664495,-0.069604844,0.16624951,-0.480232,-0.2737528,0.28806964,&
0.019909188,0.032105964,-0.06471802,-0.016468313,0.046456203,0.32101837,-0.006271394,0.024903353,&
-0.02566501,-0.056328855,0.011340883,-0.088344805,0.08954487,-0.05173229,-0.084072605,-0.00766651,&
-0.15839794,-0.008275817,-0.02500315,-0.006312878,-0.09746543,0.001957539,-0.034539472,0.07287271,&
-0.01689186,-0.018250285,0.017655244,-0.058009,-0.09626,-0.16727522,-0.012124847,0.05673219,&
0.08561751,0.1253973,0.12868243,-0.017100442,0.10167773,-0.12795056,0.017061895,-0.14542478,&
0.17087334,0.007157909,-0.03231279,0.0533311,-0.03709877,0.000960593,0.011214785,0.100563325,&
0.017743023,-0.01105827,0.005905198,-0.08388736,-0.038922638,-0.021670783,-0.058205403,0.08063244,&
-0.2123803,0.032987345,0.031878456,0.093604416,-0.048297357,0.0627878,0.04220742,-0.08483169,&
-0.2114928,-0.14226279,-0.20933847,0.19166063,-0.24167466,-0.0889901,0.09112988,0.07232203,&
0.004470127,-0.051678617,-0.10422668,0.053231344,0.027056685,0.085584655,-0.03823666,0.04559594,&
0.2511015,0.107057706,0.3918994,-0.025312012,0.14769472,-0.25759828,0.057037916,-0.002729228,&
-0.1041275,-0.12081494,0.012822963,0.13361308,0.032001235,0.119996175,0.12487555,-0.08756589,&
-0.18734947,-0.1383871,0.055500675,-0.14356141,0.04182805,-0.00626401,-0.106775135,0.035620652,&
-0.11675369,0.040788338,-0.21279997,0.030996162,-0.059408195,0.06891856,-0.15416445,0.019437805,&
0.17215818,0.003020854,0.13696541,0.06759428,0.28187826,0.18677287,0.0929167,-0.16560231,&
0.13710696,-0.056952126,0.44389912,0.015738688,0.06955268,0.44581005,0.39090028,0.07572173,&
-0.029229391,0.05801195,0.27420607,-0.05972477,-0.015420822,-0.3256936,0.0794899,-0.04695895,&
-0.30558506,-0.1860265,0.014024533,-0.007888041,0.2572193,-0.0006503539,-0.10853297,-0.27383503 &
/),(/8,126/))
real, dimension(2,8) :: hidden1 = &
Reshape((/2.6575983,-1.4676905,&
-4.5135727,1.9811615,&
0.7159135,-1.8264372,&
0.24233775,-1.5389671,&
-2.8931937,2.7457592,&
0.90245855,-1.1183532,&
-0.86101234,3.4614055,&
-2.5538857,2.7616847 &
/),(/2,8/))
real, dimension(1,2) :: hidden2 = &
Reshape((/-24.1656,-21.4007/),(/1,2/))
real, dimension(8) :: bias1 = &
(/0.37547,-2.1564,-2.2353,-3.0153,-0.13106,-0.50883,7.1345,6.4218/)
real, dimension(2) :: bias2 = &
(/-0.96102,-12.8673/)
real, dimension(1) :: bias3 = &
(/23.0116/)
contains
subroutine fnet_CCFB_initall()
end subroutine fnet_CCFB_initall
subroutine fnet_CCFB_engine(inarray, outarray, init)
intrinsic MatMul, Size
real, dimension(:), intent(in) :: inarray
real, dimension(:), intent(inout) :: outarray
real, dimension(126) :: inarray2
real (kind=8), dimension(8) :: layer1
real (kind=8), dimension(2) :: layer2
real (kind=8), dimension(1) :: layer3
integer , intent(inout) :: init
integer :: i, j
!do i = 1, 126
! inarray2(i) = inarray(127-i)
!end do
layer1 = MatMul(input,inarray)
layer1 = layer1 + bias1
do i = 1, Size(layer1,1)
layer1(i) = 1.0 / (1.0 + DEXP(-1.0 * layer1(i)))
end do
layer2 = MatMul(hidden1,layer1)
layer2 = layer2 + bias2
do i = 1, Size(layer2,1)
layer2(i) = 1.0 / (1.0 + DEXP(-1.0 * layer2(i)))
end do
layer3 = MatMul(hidden2,layer2)
layer3 = layer3 + bias3
outarray(1) = layer3(1)
end subroutine fnet_CCFB_engine
end module fnet_CCFB