forked from dwr-psandhu/ann_calsim
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfnet_JP.f90
183 lines (181 loc) · 13 KB
/
fnet_JP.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_JP
! a = 0.0002308
! b = 0.06699
intrinsic Reshape
real, dimension(8,126) :: input = &
Reshape((/-0.243785,-0.130800,-0.148890,0.027415,-0.036093,-0.154677,-0.053701,-0.250438, &
-0.095202,-0.019022,-0.019020,0.036108,-0.016947,0.084038,0.108289,-0.014384, &
-0.134655,0.187273,0.084821,0.258333,-0.091196,0.044067,0.173261,0.051008, &
-0.288525,0.166302,0.094124,0.500668,0.052200,0.103719,0.176857,0.024742, &
-0.097678,-0.112718,0.081283,-0.031805,0.169305,0.374263,0.126894,0.072206, &
-0.215405,0.016791,0.037286,0.089188,-0.030979,0.420553,0.066089,0.100709, &
-0.137500,0.075927,0.079865,-0.011906,-0.118720,0.420817,-0.012248,0.062491, &
-0.310161,-0.093713,-0.043542,-0.095925,0.103986,0.032375,0.347712,-0.000266, &
-0.382484,-0.351699,0.421515,-1.012302,0.090782,0.806377,0.295965,-0.191527, &
-0.507675,-0.540816,0.286200,-1.501579,-0.252642,-0.130631,0.186888,-0.076789, &
-0.074820,0.118072,0.481091,-0.201901,-0.342680,-0.595532,0.153831,0.294279, &
0.779316,0.858773,0.122310,0.894603,0.031839,1.584046,-0.271993,-0.072419, &
0.071537,-0.340867,-0.006216,-0.091920,0.213158,-0.627100,0.036193,0.151711, &
-0.200652,-0.028526,-0.080993,-0.013206,0.158539,0.431791,-0.013410,-0.268320, &
0.175538,0.092928,0.081333,-0.176184,0.017115,0.232145,-0.062585,-0.255861, &
-0.460583,0.328928,0.059482,-0.028190,-0.301110,0.108355,0.076340,-0.245441, &
0.514872,-0.270515,0.037928,-0.661906,-0.265234,0.035371,-0.441226,0.665582, &
-0.164330,0.400863,0.193022,-0.105092,-0.095924,0.563567,0.344790,0.121538, &
0.188986,-0.383980,0.380873,-0.258287,-0.025607,-1.435659,-0.357324,0.443258, &
0.537042,0.424026,0.770542,-0.644534,-0.145300,0.456558,-0.509684,0.677557, &
0.629212,0.406338,0.463170,-1.137657,-0.173856,0.881236,-0.410748,0.229905, &
-0.136567,-0.185426,-0.387492,-0.560106,0.288834,0.526977,-0.383780,-0.002055, &
-1.020885,-0.361082,-0.250828,-0.717694,0.090382,0.060898,-0.254873,-0.524874, &
0.583584,-0.280972,-0.123562,-0.771433,0.539246,0.310679,-0.719118,-0.714146, &
0.303813,-0.230375,0.034282,-0.497005,0.709128,-0.123241,-0.273012,-0.219257, &
0.899719,-0.232394,-0.227914,-0.511428,1.204405,-0.159030,-0.342320,0.051759, &
0.744586,1.185347,0.689612,-0.280353,0.373804,-0.494645,-3.540573,-0.060541, &
-0.893067,1.411411,-0.620845,0.266413,0.371507,0.673405,-1.667153,-1.114985, &
0.436808,-0.080676,-1.437116,-0.253386,0.661157,-1.783201,-0.701836,0.085716, &
-0.331607,-0.101454,-0.654658,0.149809,0.395652,-0.484030,-0.462893,-0.148251, &
-1.141061,0.671603,-0.043946,0.238556,-0.308298,-0.109330,0.090453,-0.229079, &
0.893699,0.271474,-0.795563,0.140194,-0.101357,0.190846,-0.439716,0.413700, &
-0.333605,-0.093992,0.158483,-0.080378,-0.183879,-0.146444,-0.289731,0.840658, &
-0.509083,-0.464560,-0.146865,-0.278193,0.137710,-1.328609,-0.219218,-0.954108, &
0.502187,0.747989,-0.317944,0.885998,0.178625,1.612401,0.098280,0.482270, &
-0.453928,0.035358,-0.101136,0.159077,-0.078185,-0.305678,-0.055581,-1.132761, &
0.415052,1.319313,-0.591266,2.387086,0.506621,1.180181,2.137710,0.264924, &
3.476435,-0.105944,0.759823,2.360948,-1.711455,-2.188242,1.942421,1.553726, &
5.771652,-0.664339,1.986950,2.806337,-3.041110,-5.756499,1.498922,0.646618, &
4.892401,-0.404618,0.911790,3.309589,-3.335293,-6.613086,0.571873,-0.129042, &
4.275119,-1.000836,0.586147,3.650468,-4.288017,-6.452590,0.383953,-0.067621, &
5.015379,-1.688813,0.149429,4.260586,-5.732294,-7.106955,0.437064,-0.524177, &
5.385969,-2.273570,-0.767811,4.384411,-7.310504,-9.175365,0.375556,-1.119985, &
6.196392,-1.916466,-2.680771,4.116218,-7.569839,-9.998798,-0.038289,-2.458835, &
14.371892,-13.324273,3.483429,13.598817,-16.754620,5.970445,11.265736,-14.066541, &
10.573110,-13.763077,5.456099,10.797833,-8.909943,13.735373,12.460994,-12.625732, &
7.306822,-11.754046,8.679847,3.906794,-1.024825,10.035103,7.279336,-10.464185, &
5.617699,-7.839496,8.012340,-0.643846,1.528698,-2.201599,2.160081,-5.752994, &
3.168449,-7.334864,8.159069,-0.149182,-0.365963,-7.345326,0.736823,-5.167510, &
-0.902017,-4.456729,7.961839,-0.006137,0.160766,-11.000654,0.045143,-4.904086, &
0.071112,-2.718457,4.991334,0.543116,-0.693962,-7.523429,1.378309,-3.898323, &
0.878175,-1.122197,3.998549,-0.265769,-0.012557,-4.306518,0.706896,-3.498060, &
-0.866752,0.190760,3.128729,-0.601642,0.170800,2.619515,0.335037,-0.945171, &
-0.626504,0.385499,0.785410,0.417499,-0.031800,1.624061,-0.103146,-0.927414, &
-2.104917,-1.160047,-1.429708,3.107798,-0.663411,-4.194542,1.521753,0.414547, &
-1.303712,-1.132223,-0.782488,1.918302,-0.716858,-3.667398,1.656148,0.319237, &
-0.798893,-1.532697,-0.224182,2.048811,-1.093932,-2.063827,1.785203,0.297829, &
-0.728981,-1.733235,0.386948,2.330052,-1.484899,-0.774680,1.605767,0.087352, &
-0.302616,-1.455355,0.599706,2.157654,-1.261906,0.098519,1.635467,0.373208, &
-0.395219,-1.345889,0.111797,1.619060,-0.792628,0.272769,1.746877,0.682703, &
-0.323545,-1.214192,-0.230948,1.431767,-0.538368,-0.284568,1.904728,0.709133, &
-0.435923,-1.020073,-0.338284,0.972421,-0.848368,0.090111,2.265030,0.156682, &
2.562286,-5.087916,1.932772,4.445519,-3.012903,6.461821,5.987084,-2.151987, &
1.833579,-4.431685,3.430649,3.753839,-1.763926,5.842651,5.784775,-1.458220, &
0.550923,-2.438737,3.891142,0.918722,-0.751195,0.082356,3.858446,2.190573, &
0.995163,-1.841549,5.112463,0.847056,-0.857050,1.093025,4.043738,0.965858, &
-2.173834,-0.216187,4.242407,-0.601519,-0.244535,-1.330510,0.002341,1.088736, &
-0.969004,-0.513779,3.555105,-1.350127,-0.708378,-0.576498,1.125251,-0.381419, &
-1.166487,0.587149,1.089997,-1.272834,-0.224564,-3.109386,-0.063245,1.354472, &
0.934747,-0.477948,-0.238722,-0.510077,-0.715854,-3.228388,1.977067,0.656952, &
0.131430,-0.612566,-3.151437,-0.759648,0.120842,-1.496890,1.226774,0.743247, &
0.988436,-1.416602,-1.471185,-1.102843,0.859816,-2.228077,2.196335,-1.135916, &
0.137521,-0.262772,0.558624,-0.467430,-0.092703,-0.226497,-0.612930,0.716815, &
0.488568,0.318563,0.192945,0.504896,0.091099,-0.007709,-0.422426,0.408745, &
0.144126,0.031959,-0.260338,0.282571,0.140569,0.190967,-0.388429,-0.065902, &
-0.336115,-0.263879,0.549662,-0.279347,0.174765,-1.158533,0.436570,0.525537, &
-0.204036,0.014333,0.025033,-0.157105,-0.392168,-0.071511,-0.213079,-0.009581, &
-0.260449,-0.066711,-0.600840,0.384013,-0.185268,0.287279,-0.370639,-0.326528, &
0.108798,-0.090582,0.137440,-0.301390,0.030305,-0.675663,0.414026,0.183052, &
0.446321,0.114113,0.589764,0.028460,-0.164874,-0.591051,-0.155448,0.971416, &
0.356577,-0.755381,-1.571747,-0.964233,0.166181,0.539010,-1.305271,-0.039746, &
0.452989,0.064086,1.068935,1.161504,-0.949444,-2.441451,-0.432971,0.931287, &
0.568935,-0.518670,-0.248405,1.180136,0.508905,1.639414,-2.013547,0.015529, &
-1.338029,-0.036966,1.249567,0.082267,0.195772,0.533306,-0.585243,-2.356600, &
-0.756990,0.293437,1.036386,0.682276,0.689114,-1.580860,-0.662276,-0.144033, &
0.448105,0.718405,2.742868,1.344451,0.440393,-0.380762,-0.310088,1.737253, &
-0.080837,-0.302760,-0.496784,-0.337947,0.528244,2.922827,-1.020917,0.890684, &
-1.106962,0.620411,-0.040784,0.922161,-0.668635,3.172011,1.601839,0.362706, &
1.197390,0.060246,-0.596979,1.188483,-0.435719,0.444094,0.500181,1.782551, &
-0.931083,-0.013762,-1.072833,0.568169,-0.268844,3.420401,0.539812,-1.665058, &
-0.220399,0.037143,0.671454,-0.455863,-0.292994,-1.440735,0.490225,-0.066446, &
-0.698998,-0.214807,0.208698,-0.020816,0.071123,-1.565134,0.067739,0.199697, &
-1.063693,-0.471040,-0.166840,0.224991,-0.013771,-0.779676,-0.282363,-0.029065, &
-0.330874,0.043818,0.451908,0.003331,0.150501,0.526177,-0.245856,0.225395, &
-0.009386,-0.092328,0.532448,0.042502,0.238976,-0.454064,-0.152504,-0.224383, &
-0.150494,0.058329,0.200740,-0.134725,-0.095298,-0.100076,-0.361301,-0.845568, &
0.425693,0.235962,0.477025,0.019721,0.282449,0.150975,-0.051458,-0.131081, &
0.677656,0.153942,0.587576,-0.097323,0.675042,1.668420,-0.686601,0.747354, &
-0.643348,0.968369,2.082062,-0.550376,1.421844,-0.232714,-0.997719,1.056253, &
0.506237,1.857961,1.974579,-1.086562,0.085813,1.142743,-0.808414,-0.275153, &
0.372268,1.328564,-1.374657,0.749668,-0.272963,1.430668,-0.561473,-1.713362, &
-0.330070,1.194592,-1.186138,1.249500,-0.988449,-0.341365,-0.983871,-1.260552, &
-0.729393,0.700217,-1.270973,0.320537,0.098473,0.388248,0.721613,-0.998702, &
-0.027059,0.072332,-0.186459,0.192958,-0.595218,-2.302679,0.506211,0.058998, &
0.070259,0.388459,-0.168649,-0.124228,-0.397280,-2.368033,0.170766,0.386670, &
0.993864,-0.207256,-1.965562,-0.698284,-0.072306,2.532968,0.842400,0.458635, &
1.365627,0.788192,-0.781654,-1.733742,0.025757,1.818454,1.032734,0.074948, &
-0.124677,0.072355,-1.569603,0.780516,0.166573,1.759031,0.114122,-0.029032, &
0.268511,0.175653,0.137949,0.158773,-0.031840,0.238089,-0.172578,0.104190, &
-0.105186,0.033283,0.138691,-0.027054,-0.052588,-0.124870,-0.047416,-0.135946, &
-0.130621,0.004086,0.153217,0.224764,0.137168,0.031615,-0.026822,0.043998, &
-0.020049,-0.232160,-0.171966,-0.170331,0.197936,0.171758,0.101744,0.125499, &
-0.130974,-0.050328,-0.211359,-0.172247,-0.056409,0.147973,0.252500,0.127765, &
0.173454,-0.042194,-0.162544,-0.116716,0.068860,0.274061,0.021357,0.120440, &
-0.265506,0.135785,0.147507,0.377417,0.024220,-0.129292,-0.014082,-0.279307, &
0.022574,-0.050838,0.138531,0.201400,0.126522,-0.382555,-0.147768,-0.099753, &
0.229989,0.002554,0.166333,-0.443268,-0.250867,0.369335,0.014610,0.114802, &
-0.078671,-0.423574,-0.035703,-0.471199,-0.046793,-0.522062,0.019287,0.096478, &
0.209179,0.192435,0.177916,0.221671,-0.115429,0.386623,-0.128276,0.164304, &
-0.567916,0.399603,-0.107729,0.281457,-0.238614,0.092380,0.661784,0.037102, &
0.311911,-0.156258,0.080385,-0.295406,-0.075335,0.117852,-0.335063,0.252107, &
-0.226418,-0.232754,-0.324958,0.091340,0.243729,0.718999,-0.030150,-0.420986, &
-0.064795,0.253670,-0.120010,0.371845,-0.076578,-0.339005,0.297452,0.307474, &
0.024563,-0.064360,0.280136,-0.524956,-0.267828,-0.376246,-0.073939,0.045736, &
0.074317,-0.260943,0.299762,-0.181056,0.272731,-0.312691,-0.144023,0.011160, &
-0.080732,0.149742,-0.457883,0.139771,-0.088230,0.625591,0.489561,0.272686 &
/),(/8,126/))
real, dimension(2,8) :: hidden1 = &
Reshape((/0.370620,-1.911776, &
-1.787596,3.304588, &
-1.373319,-2.044963, &
1.305275,-1.932276, &
8.423377,7.237323, &
0.197383,-1.136927, &
0.334031,-1.978068, &
7.319189,8.143041 &
/),(/2,8/))
real, dimension(1,2) :: hidden2 = &
Reshape((/0.139911,3.504691/),(/1,2/))
real, dimension(8) :: bias1 = &
(/-5.950042,5.087844,-6.50856,-6.446288,4.587648,2.646943,-4.337626,3.074187/)
real, dimension(2) :: bias2 = &
(/-0.126075,1.241636/)
real, dimension(1) :: bias3 = &
(/0.051228/)
contains
subroutine fnet_JP_initall()
end subroutine fnet_JP_initall
subroutine fnet_JP_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_JP_engine
end module fnet_JP