forked from dwr-psandhu/ann_calsim
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfnet_antioch.f90
183 lines (181 loc) · 13.1 KB
/
fnet_antioch.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_antioch
! a = 8.5267e-005
! b = 0.087541
intrinsic Reshape
real, dimension(8,126) :: input = &
Reshape((/-0.053141,-0.020227,-0.313927,-0.135948,-0.273781,-0.312309,-0.594306,0.123986, &
0.011713,-0.121727,0.183335,-0.119491,0.015477,-0.317727,0.737608,0.246957, &
-2.449398,0.517198,-0.119536,-6.643565,-5.149908,5.944805,-1.671942,-0.230132, &
0.793442,0.148191,1.429937,-0.176974,-3.856052,0.566422,-3.730770,2.474836, &
0.349659,-0.075145,-0.322689,-0.416050,-0.832740,-0.380659,0.581051,0.064392, &
-0.124882,-0.014185,0.091738,-0.020755,-0.288604,-0.038775,0.213902,0.242244, &
0.172991,-0.049043,0.092398,-0.280941,0.053791,0.252568,-1.089584,-0.208604, &
-0.007498,0.024884,0.009573,0.403800,0.203622,-0.292135,0.249565,0.138224, &
0.434433,0.061830,-0.389554,0.385418,-0.017424,-0.475930,1.179327,0.063452, &
-5.981185,-0.913192,-0.615590,-3.785567,-2.448128,9.805032,-1.439706,-5.325935, &
-1.332717,-0.640107,-0.802664,0.232007,-1.973475,1.376197,-4.113089,-0.833696, &
0.250457,-0.042857,-0.343850,0.305590,-0.165483,-0.103303,0.766972,0.166682, &
0.106681,-0.010942,0.286955,-0.284237,-0.234691,0.007660,-0.163379,0.140773, &
-0.051061,0.009016,0.037961,-0.069677,-0.034081,0.216940,0.306484,-0.008542, &
-0.062906,-0.001581,0.147764,0.099721,-0.018878,0.060925,0.172434,0.088720, &
0.361227,0.182255,-0.482112,0.175401,0.093801,-0.040879,0.782539,0.440045, &
-7.658982,-1.313087,0.744752,-5.752422,-2.046459,8.281917,-2.060197,-6.433518, &
-2.123177,-1.082600,-0.728013,0.591909,-1.389576,1.662126,-3.817627,-1.927033, &
0.081678,-0.026155,-0.013839,0.221993,0.002847,-0.096964,0.475575,0.254986, &
0.285545,-0.079522,0.051576,-0.249168,-0.115226,0.208283,-0.378474,0.125976, &
0.021694,0.006269,0.107087,-0.124298,0.366131,0.246184,-0.110698,0.031758, &
-0.093478,0.056553,-0.231819,-0.099823,-0.035191,0.126466,0.054430,0.095641, &
0.276133,0.353091,-0.645436,0.573460,0.124374,-0.057094,-0.255386,0.498045, &
-7.130573,-2.111433,0.439742,-7.523157,-2.835200,5.893200,-2.962165,-6.517431, &
-2.420021,-1.228900,-0.803524,0.762146,-1.636643,1.583102,-3.330954,-2.315408, &
0.019910,-0.120765,0.210392,0.067715,0.209823,-0.253893,0.075749,0.146373, &
0.163770,-0.149393,0.118754,-0.391551,-0.205498,0.269239,0.080775,0.251771, &
-0.018639,-0.002941,0.014975,-0.384476,0.155503,0.141975,-0.059391,0.017092, &
0.099703,-0.035862,-0.359647,-0.164247,-0.222827,0.141776,0.175247,-0.170831, &
0.404233,0.229721,-0.345901,0.393453,0.054889,-0.128840,-0.386668,0.232238, &
-6.427697,-2.460177,0.301512,-9.010796,-4.199285,3.793541,-2.032588,-6.233653, &
-1.868712,-1.337430,-0.654598,0.930449,-1.672705,1.093996,-2.185393,-2.550569, &
0.018064,-0.044393,0.260517,-0.202034,0.300449,-0.112702,-0.235158,-0.110373, &
0.084187,-0.043305,0.170956,-0.558847,-0.189100,0.097376,-0.248594,0.381977, &
-0.031614,-0.040040,-0.151549,-0.145781,-0.186266,-0.031800,1.120754,0.084057, &
0.090902,0.031706,-0.241966,-0.006595,-0.033362,0.101502,0.097975,-0.287926, &
0.334590,0.165173,-0.111096,0.154195,-0.015854,-0.278169,0.004586,0.242508, &
-6.072854,-2.914833,-0.787266,-9.116833,-5.118607,3.196633,-0.404552,-6.285116, &
-1.572677,-1.269979,-0.677555,-0.285226,-1.715897,0.148185,-0.726064,-2.601518, &
0.092315,-0.184712,-0.158855,-0.214120,0.004580,-0.279793,-0.134362,-0.182810, &
0.081482,0.097329,-0.420220,-0.478268,0.163024,0.035693,-0.609325,0.286664, &
-0.001514,-0.051472,-0.101892,-0.351239,-0.286470,0.342577,-0.319380,0.032481, &
0.142466,-0.081825,0.080129,-0.052927,-0.033692,0.098938,-0.018293,-0.229824, &
0.224998,0.323166,0.024868,-0.095677,0.385954,0.099040,-1.103952,0.227261, &
-6.904087,-3.919991,-0.607229,-7.921335,-5.629028,4.077300,0.292205,-7.231233, &
-1.038892,-1.005664,-0.106681,-1.422507,-1.497777,-1.019933,1.408372,-2.713927, &
0.105051,-0.280525,-0.046874,-0.228442,-0.383852,-0.326784,0.177843,-0.010405, &
0.284303,-0.054537,-0.516748,-0.360816,-0.057181,-0.080791,0.059218,0.284385, &
-0.008844,-0.008964,-0.014309,0.069989,0.012265,0.128854,0.278495,0.095657, &
0.159933,-0.032290,-0.095422,0.306493,0.279533,-0.332791,-0.433275,-0.104662, &
0.312708,0.302053,0.406069,-0.700208,0.604981,0.071827,-0.100151,0.421889, &
-7.009984,-4.424703,0.612355,-6.476908,-6.428080,5.347464,-0.344568,-7.313319, &
-1.377772,-1.257161,0.465526,-2.500804,-0.832389,-1.903019,2.516172,-4.162145, &
-0.126191,-0.082641,-0.076893,0.632825,-0.654694,0.417848,0.955624,-0.281315, &
0.151352,0.185154,-0.286628,-0.537992,0.169556,-0.118916,0.701687,0.559889, &
0.002616,-0.026637,0.104673,0.457749,0.128832,-0.251345,-0.582032,0.055046, &
-0.073581,-0.032537,0.177375,0.525664,0.423122,-0.373592,0.790307,0.344091, &
0.950282,0.881021,1.277289,-2.202570,-0.755891,0.670377,0.181994,1.232527, &
-18.155570,-19.733301,-11.096182,3.424037,-2.321535,20.568504,-18.772575,-14.803992, &
-3.325371,-4.002635,-0.681376,-5.061001,1.057260,-1.464466,5.673614,-4.226225, &
0.033448,-0.107913,0.847975,0.508633,-0.415907,-1.651564,0.653246,0.655659, &
0.491680,0.971927,0.811013,-0.091030,-0.429466,-0.825248,0.327146,0.926030, &
-0.025466,0.052680,-0.196852,-0.231106,0.091221,0.512029,-20.390446,-0.666167, &
0.111379,-0.035262,0.836874,-0.423266,0.621692,0.707270,-0.191254,0.217635, &
0.972965,0.589701,0.873173,-0.990591,-0.153159,0.263260,1.129330,-0.002780, &
-8.799219,-16.702288,-12.403825,-4.824640,-9.328213,12.738319,-16.074140,-5.733047, &
-2.307905,-3.660504,-5.951807,-2.381522,-1.220824,-2.728155,3.741741,0.407655, &
-0.548203,-0.847316,0.894589,-0.027638,-0.496126,0.672784,0.139152,-0.671459, &
0.097431,0.904100,0.533013,0.607108,0.364528,-0.198031,-0.891343,-0.481139, &
0.056640,-0.061110,-0.290636,-0.458282,-0.104164,-0.124470,-2.362782,0.051257, &
-0.227965,0.501095,-0.733203,0.070382,0.599468,0.287977,-0.631219,-0.030374, &
0.383991,0.460645,0.394171,0.067360,0.475481,0.215091,-2.500982,-0.098635, &
-0.983927,-12.015983,-7.229540,-7.238437,-8.838600,7.714808,-23.338100,-2.538423, &
-1.735529,-1.995297,-5.689832,1.812560,-1.981310,-2.043813,5.841770,1.072489, &
0.186226,0.604310,-0.234727,0.458749,-0.476207,0.835060,-0.153865,0.235002, &
-0.270520,0.287177,0.497892,-0.859174,0.306299,-0.100204,-2.014183,0.107881, &
-0.211133,0.062816,0.498264,0.594607,0.431396,-0.461413,-0.561700,-0.031276, &
-0.024600,-0.100637,-0.056656,0.083631,-0.269309,-0.053083,0.614685,-0.016629, &
0.054632,0.384701,0.732495,0.277500,0.018826,0.697446,1.340302,0.121369, &
0.452505,-6.243049,-3.523532,-9.034825,-5.338200,2.471697,-5.276472,-0.593752, &
-1.342659,0.131512,-5.561814,7.213787,-3.800994,0.931792,4.484454,1.768912, &
0.066779,-0.053935,0.770438,0.987241,0.505830,0.982087,-3.125161,1.485718, &
-0.089601,0.271960,-0.103531,-1.311198,-0.288937,-0.356131,-1.070482,-0.080586, &
-0.073125,0.048295,-0.291570,0.213419,0.072848,-0.083363,2.326878,0.322372, &
0.126845,-0.104567,-0.164968,-0.398158,-0.015558,-0.376342,-0.181545,0.079111, &
-0.614305,0.518614,0.289355,1.330495,-0.372772,-1.280499,0.201855,0.318709, &
-0.955219,-4.084753,-7.004333,0.356639,-4.937799,4.467316,-7.987762,1.522406, &
0.484529,-0.981972,-6.262934,1.653776,0.916288,-1.096728,3.284124,-0.071425, &
0.090305,-0.103556,1.584404,-0.771248,0.098865,2.284812,-1.205025,1.684503, &
-0.316893,0.169702,0.023889,-0.250074,0.018579,0.842022,-0.303540,-0.257626, &
0.093535,0.008524,0.421313,-0.165845,-0.008714,0.406500,-1.998627,-0.473079, &
0.197165,-0.026821,0.316130,0.436210,-0.563380,-0.102695,-0.959025,-1.182209, &
-0.237808,0.153635,-0.297679,-0.165490,0.003161,-0.915296,4.157079,-0.373567, &
-1.369870,-0.363417,-6.578188,1.347344,-5.136279,2.849770,-3.114996,1.747219, &
2.113495,-0.344060,-4.546538,-3.641280,0.002152,-1.363327,-1.348347,-0.898073, &
0.844129,-0.597368,-0.649291,0.465687,-0.198291,-0.327034,0.545812,0.212708, &
-0.076587,0.101280,0.809916,-0.284998,0.390668,-0.554377,0.873581,-0.441217, &
-0.087828,0.020174,-0.374945,-0.198258,0.135205,-0.156431,-0.199078,0.108171, &
-0.020049,0.118397,-0.300503,0.056987,0.535271,-0.274019,-0.342413,0.042320, &
-0.045480,0.152382,0.645826,0.948116,0.784931,-0.696180,-1.885336,0.753780, &
-0.164201,-0.505509,-5.031278,0.000667,-1.760009,-0.117988,-3.040861,-1.099824, &
-0.535305,-0.113863,-4.216253,-4.819402,1.154157,-1.834960,0.718471,-0.286175, &
0.954488,0.521102,-1.069095,-0.863378,0.467505,0.552897,-1.523810,0.676117, &
-0.115355,-0.207239,0.527544,0.048137,0.299642,0.086724,-0.193499,0.343346, &
-0.074302,-0.025431,0.376610,0.481358,-0.169296,-0.675050,-0.399640,-0.021682, &
-0.429039,0.201394,0.297548,-0.156725,0.412417,0.834596,0.142051,0.877179, &
0.315292,-0.153031,-0.575379,0.303949,-1.005356,-0.195599,-0.026979,-0.926308, &
0.325397,-1.086370,-6.707109,-2.260257,-2.433598,1.107130,2.300148,0.477351, &
-0.180971,0.416955,-1.640492,-4.415041,1.722215,1.327790,-2.935185,0.382618, &
-0.390536,0.190082,-1.075869,-0.525111,1.258051,0.704439,-2.351827,0.295964, &
-0.171518,-0.046438,-0.112476,-0.197050,-0.149374,-0.246060,0.135467,-0.409087, &
0.077767,0.022983,0.024955,-0.228004,0.339490,0.537317,0.326591,0.095229, &
0.219608,0.048900,0.224357,-0.465809,0.258275,0.049245,1.609022,-1.188980, &
0.353167,-0.326086,0.798817,0.701801,-0.108012,-0.613898,0.367490,-0.059728, &
-0.246231,-0.854664,-0.905633,-2.436207,-2.769888,2.302612,4.106526,0.495197, &
-0.031105,0.123091,0.416451,-5.681253,1.244454,0.109695,-4.997224,-0.301062, &
-0.347691,-0.315830,-0.743812,-0.108170,0.659037,-0.646165,0.376436,-1.580441, &
0.086595,0.092350,-0.147912,0.158912,-0.085512,-0.328971,1.058762,-0.258548, &
-0.060600,0.008497,-0.227597,0.171639,0.048243,-0.369421,0.014582,0.160669, &
0.306657,0.045630,-0.472610,0.259462,0.063732,-0.579384,1.229163,-1.805364, &
-0.534174,0.136233,-0.048989,-0.062403,0.078667,-1.180846,-1.786412,0.994286, &
0.655702,-0.383597,0.878449,1.173936,-0.932950,7.743892,-1.869024,-0.893540, &
0.270430,0.718047,0.284624,-3.607296,1.013713,2.480535,-1.734270,-0.970918, &
0.100736,-0.057145,-0.304083,-1.022633,0.400625,0.205376,-1.006416,-0.686786, &
0.046426,-0.054038,-0.274117,0.400741,-0.288066,-0.502950,0.433995,-0.124885, &
0.092592,-0.013521,0.082285,-0.082115,-0.123501,0.281668,-0.030026,-0.372862 &
/),(/8,126/))
real, dimension(2,8) :: hidden1 = &
Reshape((/1.241288,-1.430909, &
1.381432,-2.538232, &
0.361019,-0.977544, &
-2.294046,2.374638, &
-0.197788,0.167343, &
-0.189323,1.045767, &
0.964698,-2.207242, &
0.186570,-0.610753 &
/),(/2,8/))
real, dimension(1,2) :: hidden2 = &
Reshape((/1.625529,-1.216374/),(/1,2/))
real, dimension(8) :: bias1 = &
(/-2.091814,-2.029025,-1.960767,1.326975,1.749763,1.800385,-1.462622,-2.012493/)
real, dimension(2) :: bias2 = &
(/-0.259468,0.635937/)
real, dimension(1) :: bias3 = &
(/0.399008/)
contains
subroutine fnet_antioch_initall()
end subroutine fnet_antioch_initall
subroutine fnet_antioch_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_antioch_engine
end module fnet_antioch