-
Notifications
You must be signed in to change notification settings - Fork 1
/
move_weights.py
27 lines (19 loc) · 14.1 KB
/
move_weights.py
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
from . import nn
WEIGHTS = [
([[0.29173779487609863, -0.20780368149280548, 0.6158523559570312, 0.31392231583595276, 0.06494702398777008, 0.6240428686141968, 0.635321855545044, 0.1321055144071579, -0.09476474672555923, 0.6137580871582031, 0.45774826407432556, 0.01754469983279705, 0.4536101222038269, 0.30077940225601196, 0.23136389255523682, 0.06493140757083893, 0.43706390261650085, 0.401468962430954, -0.12217403948307037, 0.4316496253013611, 0.500754177570343, 0.17273178696632385, 0.2697788178920746, 0.40746399760246277, 0.22216299176216125, -0.2689223289489746, 0.33682599663734436, 0.601184606552124], [0.02582261897623539, -0.9443424940109253, 0.1957673281431198, 0.4106607139110565, 0.4284701645374298, 0.3584376573562622, 0.17875120043754578, 0.20495551824569702, -1.1071118116378784, 0.13877429068088531, 0.4202403426170349, 0.2241850197315216, -0.10593297332525253, 0.11406155675649643, 0.07104627043008804, -1.1527953147888184, 0.3292767107486725, 0.11433932185173035, -0.09272728860378265, -0.09829312562942505, 0.20219510793685913, 0.09291190654039383, -0.7247479557991028, 0.7496740818023682, 0.3543095290660858, -0.10872967541217804, -0.16551926732063293, 0.07211866229772568], [-0.08830876648426056, -0.4015217423439026, 0.5869113206863403, 0.12120901793241501, -0.336713582277298, -0.4139258563518524, -0.35667112469673157, -0.2485971450805664, -0.3660503327846527, 0.203626811504364, 0.2687089443206787, -0.24703283607959747, -0.4127354025840759, -0.32024088501930237, -0.04964425414800644, -0.386724591255188, 0.24909739196300507, -0.015131218358874321, -0.2142150104045868, -0.16267642378807068, -0.3424883782863617, -0.18064363300800323, -0.28098630905151367, 0.1682676523923874, 0.3832460939884186, -0.27415329217910767, 0.38037654757499695, -0.44624975323677063], [0.6286669969558716, 0.5116724371910095, -0.07768627256155014, 0.20170295238494873, 0.8628861308097839, -0.11737436801195145, 0.009403418749570847, 0.9001739621162415, 0.6994674205780029, 0.06579950451850891, 0.020675621926784515, 0.35537803173065186, -0.40113601088523865, -0.004479481838643551, 0.7983353734016418, 0.32446953654289246, 0.17715813219547272, 0.1492316573858261, -0.10778737813234329, -0.5536902546882629, 0.22350189089775085, 0.6128801107406616, 0.22860687971115112, 0.22666357457637787, 0.1326581835746765, -0.18099884688854218, -0.5105274319648743, 0.29054513573646545], [0.42663705348968506, 0.05900311842560768, -0.20458145439624786, -0.5255295634269714, -0.03543312847614288, -0.27001890540122986, 0.01881147176027298, 0.5050208568572998, -0.07994457334280014, -0.1103096604347229, -0.3190288543701172, -0.3496573865413666, -0.02576255053281784, 0.06583492457866669, 0.30896714329719543, 0.1849677413702011, 0.037043094635009766, -0.15313056111335754, -0.3037983477115631, -0.35152775049209595, 0.3212125897407532, 0.33324116468429565, 0.13429728150367737, -0.024795593693852425, -0.28063786029815674, -0.2013850063085556, -0.45174431800842285, 0.34211134910583496], [-0.23134832084178925, 0.16382385790348053, 0.541893482208252, -0.23250345885753632, -0.2527710795402527, 0.5099197626113892, 0.35943010449409485, -0.33356693387031555, 0.30700287222862244, 0.5586403012275696, -0.25683286786079407, -0.35619398951530457, 0.45373210310935974, 0.7170729041099548, -0.4726543426513672, 0.24995282292366028, 0.7444196343421936, 0.009488780051469803, -0.14438612759113312, 0.4059900641441345, 0.6650460958480835, -0.2391381412744522, -0.0048474413342773914, 0.29202157258987427, -0.3525082468986511, -0.01156225148588419, 0.5061500668525696, 0.5587971210479736], [0.2840424180030823, -0.3404671549797058, 0.13464194536209106, 0.36732006072998047, -0.42216211557388306, 0.3156176507472992, 0.19943605363368988, -0.14995475113391876, -0.42561817169189453, 0.14448696374893188, 0.31444498896598816, -0.3835216760635376, 0.3648989498615265, 0.2345251739025116, -0.136868417263031, -0.2700711190700531, 0.07994316518306732, 0.04187055304646492, -0.3972890079021454, 0.46208280324935913, 0.16413737833499908, 0.015904167667031288, -0.2699967920780182, 0.10189869999885559, 0.3306012749671936, -0.22605541348457336, 0.6205037236213684, 0.38845744729042053], [-0.20597992837429047, -0.2254924178123474, 0.34866321086883545, 0.34271353483200073, 0.11211498081684113, 0.13676755130290985, -0.3460991382598877, -0.013935178518295288, -0.13536222279071808, 0.2065693587064743, 0.17472587525844574, -0.17194156348705292, -0.17131541669368744, -0.1749405860900879, -0.13031430542469025, -0.20057742297649384, -0.015440632589161396, 0.252091646194458, -0.4082920551300049, -0.06771537661552429, -0.23994554579257965, -0.10863856971263885, -0.06426670402288437, 0.10500718653202057, 0.3211217522621155, -0.5789031386375427, -0.16737337410449982, -0.34584519267082214], [0.4736616313457489, 0.3274608552455902, -0.14077018201351166, 0.07403523474931717, 0.6848536133766174, -0.17451238632202148, 0.19496376812458038, 0.6511680483818054, 0.17119766771793365, 0.014888469129800797, 0.02664869837462902, 0.4434184730052948, -0.04673689603805542, 0.14423272013664246, 0.5603947639465332, 0.39296042919158936, 0.29225674271583557, 0.3093336522579193, 0.1379765421152115, -0.24837450683116913, -0.017658160999417305, 0.6965325474739075, 0.3328437805175781, 0.00022347664344124496, -0.04536588117480278, -0.2540808916091919, -0.7034162878990173, 0.11840178072452545], [-0.10193061083555222, -0.10343968123197556, 0.07809203863143921, -0.2183070182800293, -0.8017588257789612, -0.8405568599700928, -0.2681190073490143, -0.37731900811195374, -0.06835529208183289, 0.01330583170056343, -0.27086445689201355, -0.34708499908447266, -0.5587500333786011, -0.4161187708377838, -0.3412564992904663, -0.09353691339492798, 0.09632734954357147, -0.37881460785865784, 0.002354174852371216, -0.16400130093097687, -0.4417874813079834, -0.2871580421924591, -0.2071923315525055, 0.21985329687595367, -0.2808866500854492, 0.5233600735664368, 0.05498730018734932, -0.4746335446834564], [0.49719521403312683, -1.0747497081756592, 0.40911591053009033, 0.006967587396502495, -0.7114499807357788, 0.18626102805137634, -0.025194397196173668, 0.39917877316474915, -1.013191819190979, 0.4021146893501282, -0.2059970647096634, -0.5247293710708618, 0.4347338378429413, -0.06066411733627319, 0.3007603883743286, -0.8906434774398804, 0.5643151998519897, -0.25072193145751953, -0.17575997114181519, 0.4513061046600342, 0.08787410706281662, 0.4309074282646179, -0.8078679442405701, 0.7126118540763855, -0.10802065581083298, -0.007863261736929417, 0.38606899976730347, 0.23585675656795502], [0.15763768553733826, -0.3231073319911957, 0.3470570147037506, -0.2155270129442215, -0.070946104824543, 0.25664228200912476, 0.2932252585887909, 0.3516489565372467, -0.4346493184566498, 0.20857952535152435, -0.2206321805715561, -0.1305142343044281, 0.2799147367477417, 0.2937750220298767, 0.18663662672042847, -0.4484110176563263, 0.5820655822753906, 0.07188500463962555, -0.03291735053062439, 0.005559176206588745, 0.16846433281898499, 0.006485719699412584, -0.013819864019751549, 0.5850145816802979, -0.2761627435684204, 0.24066340923309326, 0.17522482573986053, 0.04127431660890579], [-0.339271605014801, 0.5200254917144775, 0.20317894220352173, 0.4084250330924988, -0.17629629373550415, -0.47082507610321045, -0.49315309524536133, -0.41073042154312134, 0.7384506464004517, 0.20678290724754333, 0.3002530038356781, -0.4404202997684479, -0.3873223662376404, -0.3569401204586029, -0.11991826444864273, 0.7284328937530518, -0.2345479428768158, 0.06321970373392105, -0.6374552249908447, -0.39109137654304504, -0.3648346960544586, -0.16322599351406097, 0.7840383648872375, -0.43072450160980225, 0.35491788387298584, -0.3372632563114166, 0.05439787730574608, -0.2782525420188904], [0.7022124528884888, -0.7222007513046265, 0.4366439878940582, -0.47695663571357727, -0.4379328787326813, -0.7677544951438904, 0.07030980288982391, 0.5995274186134338, -1.0126148462295532, 0.6468373537063599, -0.4008636474609375, -0.10805735737085342, -0.780610978603363, -0.18205541372299194, 0.3804691731929779, -0.6625329852104187, 0.6061536073684692, -0.5580118894577026, -0.035792991518974304, -0.7153411507606506, -0.22600823640823364, 0.3645414113998413, -0.6357652544975281, 1.08731210231781, -0.5734360814094543, -0.27984198927879333, -0.4300639033317566, -0.23756244778633118], [0.03426188975572586, -0.253370076417923, 0.1771896481513977, 0.3229159116744995, 0.5461472272872925, 0.09110088646411896, 0.20931477844715118, 0.3403955399990082, -0.48210689425468445, 0.401013046503067, 0.33491766452789307, 0.3120896816253662, 0.31931912899017334, 0.16384683549404144, 0.2643328905105591, -0.627718448638916, 0.3793911635875702, 0.44247785210609436, 0.030986472964286804, 0.159744530916214, -0.14134633541107178, 0.20732702314853668, -0.45517075061798096, 0.6532341837882996, 0.2985600233078003, -0.0499887689948082, 0.1510448455810547, 0.1455545872449875], [0.04514604061841965, 0.5732373595237732, -0.0809207484126091, 0.12443996965885162, 0.0548776313662529, 0.38927051424980164, -0.13019293546676636, 0.29196086525917053, 0.6666940450668335, 0.032346442341804504, 0.18381918966770172, 0.1106097549200058, 0.3084776997566223, -0.15089985728263855, 0.2999918758869171, 0.7084556221961975, 0.08679396659135818, 0.2837747037410736, 0.07086776942014694, 0.2379039227962494, -0.27630069851875305, 0.3532118499279022, 0.6216872930526733, -0.39278215169906616, 0.12167084962129593, 0.18091021478176117, 0.13280151784420013, -0.10826908051967621], [-0.3838548958301544, 0.6693034172058105, -0.27509552240371704, -0.03679269179701805, -0.4683592915534973, -0.570372462272644, -0.46004945039749146, -0.22290903329849243, 0.9320969581604004, -0.4490104019641876, 0.08738400042057037, -0.807092010974884, -0.2588486671447754, -0.4104536473751068, -0.3038703501224518, 0.9024710059165955, -0.4142400622367859, 0.025273339822888374, -0.49164652824401855, -0.23035363852977753, -0.36864909529685974, -0.14434309303760529, 0.8061864376068115, -0.5958651304244995, 0.17631572484970093, -0.335598349571228, -0.1103254035115242, -0.5812957882881165], [0.0962071567773819, 0.6502065062522888, -0.0345434732735157, -0.05183761939406395, 0.21699273586273193, 0.3655833899974823, 0.07905156165361404, 0.1932557225227356, 0.5998788475990295, -0.19557756185531616, 0.031999360769987106, 0.4196895360946655, 0.032536692917346954, -0.017029929906129837, 0.27623116970062256, 0.3954407274723053, -0.015896974131464958, 0.16549769043922424, 0.05563563108444214, 0.01651964709162712, 0.12787020206451416, 0.4030655324459076, 0.5751152038574219, -0.6212669610977173, 0.17147181928157806, -0.19977912306785583, -0.36335816979408264, -0.14861415326595306], [-0.22509446740150452, 0.7578756213188171, -0.053267236799001694, 0.21544556319713593, 0.3278709352016449, 0.14331871271133423, -0.5212048292160034, -0.012216009199619293, 1.133765697479248, -0.11735173314809799, 0.19556497037410736, 0.012056076899170876, 0.11632513254880905, -0.23993326723575592, 0.23013943433761597, 0.7084344625473022, -0.13803371787071228, 0.14421962201595306, -0.33758270740509033, -0.3425660729408264, -0.5450136065483093, 0.11319468170404434, 0.865530788898468, -0.6228510737419128, -0.0018122466281056404, -0.4137793779373169, -0.5843698382377625, -0.3085904121398926], [0.35215532779693604, 0.5789998769760132, -0.25594866275787354, 0.18019482493400574, 0.24134081602096558, 0.5149408578872681, 0.34111663699150085, 0.5090202689170837, 0.5456219911575317, -0.020526522770524025, 0.27832210063934326, 0.2842891812324524, 0.222159281373024, 0.10195254534482956, 0.5370196104049683, 0.5385713577270508, 0.0955343097448349, 0.27461954951286316, 0.22890329360961914, 0.04983336478471756, 0.1627270132303238, 0.633804202079773, 0.6580145359039307, -0.16844390332698822, 0.1385611593723297, 0.14221887290477753, -0.018305564299225807, 0.35390108823776245]], [[0.6687496900558472, 0.5785053372383118, 0.21236439049243927, -0.7904329299926758, -0.33198514580726624, 0.7863677144050598, 0.5504491329193115, 0.6298533082008362, -0.5848833322525024, -0.1401001363992691, 0.6743378639221191, 0.4194968044757843, 0.3777656853199005, 0.0668175220489502, 0.10846426337957382, 0.46629247069358826, -0.12821434438228607, 0.5778796672821045, 0.22930298745632172, 0.40775957703590393]]),
([[0.6109929084777832, 0.17228971421718597, 0.12910276651382446, -1.5221116542816162, -1.223200798034668, -0.10580325126647949, 0.6071208119392395, -0.1752786785364151, -0.9002181887626648, 1.125972032546997, 0.5828909277915955, -0.17551130056381226, -0.10847457498311996, 0.4752224087715149, -0.059666115790605545, -0.44239020347595215, -0.01619202271103859, -0.6634722948074341, -0.5857982635498047, -0.5698651671409607], [-0.5252135396003723, -0.17081941664218903, -1.260846734046936, -0.31003549695014954, 0.031818367540836334, -0.24336284399032593, 0.10527829080820084, -0.3434891402721405, -0.7389802932739258, -0.13743746280670166, -0.41735705733299255, -0.10476254671812057, -0.7349851131439209, -0.9842692613601685, 0.3765483498573303, -0.2766721844673157, -0.360236257314682, -0.17983350157737732, -0.539465069770813, -0.3471129834651947], [-1.6527156829833984, 1.3220423460006714, 0.24842669069766998, -1.118962049484253, -0.6092254519462585, -1.2322725057601929, -0.6439716219902039, 0.1778736412525177, -0.5714645385742188, 0.0908455103635788, -0.498287558555603, -0.24985209107398987, -0.301382839679718, 0.1479571908712387, 0.4632068872451782, -0.517104983329773, -0.5412337779998779, -0.19561076164245605, -0.38381844758987427, -0.4416774809360504], [0.013884692452847958, 0.3166307508945465, -0.3616737127304077, 0.2457173615694046, 0.1879628449678421, 0.5465814471244812, 0.8165813684463501, -0.37526199221611023, 0.2333282232284546, 0.26443222165107727, 0.5657868981361389, 1.1602156162261963, -0.7081702351570129, 0.32396745681762695, 0.7343623638153076, 0.5331559181213379, -0.8634595274925232, 0.11612781137228012, -0.17356470227241516, 0.5539993643760681]], [[0.2743951976299286, -0.4796745479106903, -0.008168893866240978, 0.15697456896305084]]),
]
def forward(x):
x = nn.linear(x, WEIGHTS[0])
x = nn.relu(x)
x = nn.linear(x, WEIGHTS[1])
x = nn.tanh(x)
return x
def test():
x = [[0.0]] * 28
y = forward(x)
print(y)
def show():
for idx, (w, b) in enumerate(WEIGHTS):
print("Layer %d:" % (idx+1))
print("W: (%d, %d), B: (%d, %d)" % (len(w), len(w[0]), len(b), len(b[0])))