-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathon_model_min.py
29 lines (29 loc) · 25.7 KB
/
on_model_min.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
27
28
29
# This model was trained using Speech Commands Dataset licensed under the Creative Commons BY 4.0 license.
# Warden P. Speech Commands: A public dataset for single-word speech recognition, 2017.
# Available from http://download.tensorflow.org/data/speech_commands_v0.01.tar.gz
from ulab import numpy as np
def _relu(x):
return np.maximum(0,x)
def _sigmoid(x):
return 1/(1+np.exp(-x))
def _layer_zero(input_data):
w0=np.array([[-1.32244080e-02,-6.78005144e-02,-3.52041006e-01,-1.05415083e-01,1.66751444e-01,6.56064227e-02,-3.78853157e-02,-9.89838913e-02,2.23399669e-01,2.85320848e-01,2.50445873e-01,6.92801028e-02],[-1.02191016e-01,-8.37643072e-02,-2.95916975e-01,-1.58257499e-01,1.16360307e-01,-1.07163645e-01,-1.65166065e-01,-9.08204019e-02,-3.66394334e-02,1.35140315e-01,2.45711394e-02,-1.69819936e-01],[-3.27901579e-02,-3.27543765e-02,-1.59817144e-01,2.66330779e-01,1.59238249e-01,1.53209850e-01,-1.67782530e-02,1.14733237e-03,-1.56439826e-01,-8.20656270e-02,3.57945450e-02,8.27838108e-02],[-1.91612113e-02,1.88947409e-01,-8.52150247e-02,1.84596434e-01,1.70900285e-01,-5.44336624e-03,-9.91927460e-02,-1.75941736e-01,1.89493001e-01,-1.58842519e-01,-1.96932420e-01,1.88692987e-01],[-3.28698158e-01,2.54173875e-01,1.13056697e-01,2.55430579e-01,1.52448490e-01,-1.48508623e-01,2.38398183e-02,-8.93116556e-03,1.38616040e-01,-3.08241785e-01,-1.85895354e-01,7.93865174e-02],[-7.91448727e-02,7.35702887e-02,-1.63453907e-01,-1.80625007e-01,9.63369608e-02,3.13525796e-02,-6.48703501e-02,-1.19550209e-02,3.94476950e-03,-5.09965494e-02,2.27988288e-02,-3.76177877e-02],[8.98591988e-03,-1.07855819e-01,1.42863672e-02,-6.31889403e-02,-7.83453658e-02,-7.91811571e-02,1.03313662e-01,2.32185367e-02,1.75183296e-01,-2.13968307e-01,-9.04838815e-02,1.82151422e-02],[7.05777034e-02,-8.12802762e-02,-6.34063827e-03,-9.03418735e-02,1.68128774e-01,3.04880679e-01,4.09542359e-02,-8.16709548e-02,3.49298954e-01,2.52717584e-01,3.04751217e-01,-3.37342210e-02],[1.43065080e-01,-1.76382944e-01,-8.34526867e-02,1.60091788e-01,7.40477117e-03,3.41890864e-02,1.15982972e-01,1.51298210e-01,-1.05994932e-01,8.11275914e-02,-2.18080059e-01,8.54972154e-02],[2.13800997e-01,5.90478778e-02,-1.93640649e-01,-1.95329636e-01,-1.61638319e-01,1.68548644e-01,-1.39853925e-01,-8.07100981e-02,2.21201539e-01,1.68414757e-01,9.16122422e-02,-5.12663797e-02],[-7.08403513e-02,1.23568662e-01,-2.98107713e-02,-1.40601158e-01,-1.40044048e-01,-1.21196985e-01,-8.36995095e-02,-1.10475071e-01,1.48155287e-01,9.63921100e-02,-1.41534150e-01,-1.76726624e-01],[-2.64013946e-01,2.49536127e-01,-2.59356815e-02,-1.71600226e-02,-2.39763826e-01,-2.45325893e-01,5.80013636e-03,5.33876382e-02,-3.15957010e-01,1.36667818e-01,-5.56372255e-02,-9.71929915e-03],[1.18512243e-01,2.81017143e-02,-1.37581319e-01,1.88746139e-01,1.11700282e-01,-1.25679240e-01,8.36948454e-02,-2.06330895e-01,-8.81667808e-03,-1.00550074e-02,-2.32849851e-01,1.50931761e-01],[-9.43301097e-02,-6.52459934e-02,1.04215011e-01,-1.59915403e-01,-9.17221904e-02,6.56031221e-02,2.24770848e-02,-9.45116580e-02,-1.68898240e-01,6.46733330e-04,3.41005735e-02,-3.69044282e-02],[-1.71580657e-01,2.71902811e-02,1.39253750e-01,2.07824558e-02,-6.03623204e-02,-3.71620394e-02,6.49003088e-02,1.46792635e-01,1.49517268e-01,3.48790083e-04,-1.52225494e-01,-1.56370342e-01],[-1.11687988e-01,3.94560732e-02,1.50652424e-01,7.08949938e-02,3.06374077e-02,-5.12072816e-02,-5.63110597e-02,-1.01562582e-01,-1.56741261e-01,-7.98315406e-02,-3.73390578e-02,-2.87534669e-02],[-1.60809830e-01,-3.76055799e-02,4.27146070e-02,1.27584457e-01,2.92279065e-01,1.42452434e-01,-4.05023731e-02,-5.77891879e-02,1.64859831e-01,1.91967756e-01,-4.31217887e-02,-2.47262362e-02],[-5.01388963e-03,-1.27224252e-02,-2.88949549e-01,5.49950525e-02,2.65345305e-01,5.81302270e-02,2.98849382e-02,-1.11626983e-01,2.99642235e-01,2.38203228e-01,1.46586418e-01,-3.61043364e-02],[-2.34767292e-02,-1.91411465e-01,-8.37070644e-02,5.91226146e-02,1.88354760e-01,-1.42283663e-01,-4.10425544e-01,-1.39151126e-01,9.89680961e-02,2.16977689e-02,-8.32162648e-02,3.81928794e-02],[5.82948998e-02,1.97043523e-01,1.14847139e-01,6.03816584e-02,1.77838892e-01,1.55997083e-01,-2.71386206e-01,-8.29244964e-04,-5.80402091e-02,-2.55567431e-01,-1.14436127e-01,1.24639384e-01],[2.07560971e-01,1.32818535e-01,8.99974629e-02,2.53873795e-01,-1.40130445e-01,1.23976931e-01,-2.22839817e-01,3.65489684e-02,-6.87289611e-02,-2.17062041e-01,-2.82775789e-01,2.89404213e-01],[7.98908696e-02,-2.15768948e-01,-5.96046150e-02,-2.42270082e-01,-2.21022576e-01,-6.03738204e-02,-7.75424466e-02,2.46320534e-02,-5.96070513e-02,3.96337435e-02,8.65682811e-02,-5.89475408e-02],[2.00787887e-01,-3.08682680e-01,4.30393703e-02,-1.82202742e-01,3.68903391e-02,1.40846968e-01,-2.77767535e-02,-1.59952238e-01,4.57009859e-02,2.39123538e-01,2.04657346e-01,-1.07783005e-01],[3.59377563e-02,5.91453649e-02,9.82947946e-02,-3.02233428e-01,2.08113357e-01,1.75296843e-01,-2.56990939e-01,-1.59379095e-01,1.79920997e-02,3.17556322e-01,1.04646273e-02,-5.35206497e-02],[-9.99894962e-02,-4.16329764e-02,-6.18162304e-02,-5.57094812e-02,-4.01244015e-02,-1.39697090e-01,-9.00903866e-02,4.25830521e-02,2.11000770e-01,7.56493285e-02,1.31634220e-01,1.69434808e-02],[8.69879574e-02,1.68373007e-02,-2.25141421e-01,-3.30366828e-02,-1.30728081e-01,6.15885779e-02,-1.46299034e-01,1.57850951e-01,9.32278782e-02,3.62421796e-02,1.82705298e-01,1.05304265e-04],[6.54712319e-02,8.03612247e-02,-1.02100901e-01,-8.97241011e-02,-2.24052574e-02,2.05874071e-01,-1.40096620e-01,-1.28553629e-01,-1.56548008e-01,-4.54177298e-02,3.64403166e-02,-3.99801433e-02],[-1.33323699e-01,-9.30032134e-02,-1.68791100e-01,-1.17204823e-02,1.75673619e-01,6.17416948e-02,-1.72386676e-01,2.50791553e-02,1.10232206e-02,6.56641871e-02,1.61401451e-01,-9.04372111e-02],[4.55341600e-02,1.36892021e-01,2.20146492e-01,3.15354198e-01,-8.65513906e-02,3.78882955e-03,-1.95486173e-02,-3.34782377e-02,4.76234891e-02,-1.38566226e-01,8.63466188e-02,7.04195276e-02],[1.85338203e-02,-4.62727882e-02,1.67542711e-01,2.33984977e-01,-3.74778882e-02,4.53184098e-02,-2.12682094e-02,4.10975367e-02,-2.52372343e-02,-3.37281562e-02,-9.99969058e-03,3.52888443e-02],[8.89197551e-03,-6.05515391e-02,-8.00014213e-02,4.58366312e-02,-8.18718225e-02,1.22859903e-01,-8.69493186e-02,-8.77248719e-02,-5.48619069e-02,3.20829675e-02,-1.50071084e-01,1.71421424e-01],[5.91466716e-03,3.79548259e-02,-5.18865027e-02,4.02053185e-02,-1.67160258e-01,-6.63440675e-02,2.67390043e-01,6.81757778e-02,2.59757608e-01,2.26788875e-02,-8.74273032e-02,-5.58348224e-02],[8.90185032e-03,1.65775448e-01,-2.29066625e-01,2.56167084e-01,3.30671728e-01,-7.04849362e-02,2.06309408e-01,3.16921353e-01,2.19298437e-01,9.67833698e-02,6.88652620e-02,1.73339367e-01],[-2.15188399e-01,-1.63838148e-01,-4.32361104e-02,1.02162510e-01,-1.41594457e-02,1.74615815e-01,2.73841321e-01,-1.32670149e-01,-1.93537712e-01,2.52381623e-01,3.80829200e-02,1.63789108e-01],[-3.71643573e-01,1.91295519e-01,1.27892077e-01,5.99033497e-02,-6.65491372e-02,1.29913747e-01,-1.24765895e-01,-1.87352076e-01,2.59918839e-01,-1.12677716e-01,1.87587380e-01,6.61467900e-03],[-1.25909848e-02,2.59732872e-01,4.11629617e-01,2.34084740e-01,-1.54996142e-01,1.43884830e-02,-2.72777319e-01,-3.63357723e-01,-4.77447473e-02,7.39499256e-02,-7.73091242e-02,1.52936593e-01],[-3.79198194e-01,-9.57798362e-02,-1.36457756e-01,1.49163023e-01,-2.37401947e-02,-1.93053201e-01,-9.74578485e-02,-2.19679594e-01,1.10776699e-03,-3.53254527e-02,-2.27477998e-01,1.94723934e-01],[-3.80948931e-02,-2.73361862e-01,-9.33463871e-02,-2.43484795e-01,-7.25540966e-02,1.12617455e-01,1.84019357e-01,-2.03079924e-01,-1.18243871e-02,5.02788305e-01,9.64249149e-02,5.32624833e-02],[1.08797014e-01,-2.88907647e-01,-3.34300607e-01,-1.60141036e-01,2.84110636e-01,1.02710977e-01,-1.60506353e-01,1.10432670e-01,-1.25695527e-01,2.66502440e-01,2.31681272e-01,6.11614659e-02],[-1.55738249e-01,-2.34118715e-01,-1.14346286e-02,2.16314290e-02,2.77069896e-01,2.58789480e-01,2.16563001e-01,9.30169299e-02,-6.13115877e-02,2.95529187e-01,1.01067401e-01,-2.21917212e-01],[-1.81607842e-01,-1.63371101e-01,-2.35666856e-02,-2.16555223e-01,-1.09780826e-01,2.25866511e-01,-2.29069665e-02,-6.39557987e-02,1.37802996e-02,2.57952720e-01,-1.22212559e-01,-8.24175552e-02],[-2.13705391e-01,-1.24065869e-01,2.79333964e-02,-2.06947654e-01,3.78302410e-02,3.29219282e-01,1.70895196e-02,-2.61484385e-01,-1.51713444e-02,1.98411405e-01,7.54725337e-02,-1.35662094e-01],[-2.35198401e-02,9.46662277e-02,-2.75621116e-01,9.30063352e-02,5.93850538e-02,-9.25295353e-02,-1.75011739e-01,3.18247110e-01,2.44902238e-01,-7.18255863e-02,1.55028868e-02,-1.71159044e-01],[-1.09857982e-02,1.01205245e-01,-2.12530255e-01,-4.86376137e-03,-9.39583778e-02,-7.85092264e-02,-1.24097161e-01,-3.55310626e-02,2.91932318e-02,-5.34950159e-02,-2.04472214e-01,2.86454801e-02],[-2.21878096e-01,3.31715420e-02,1.95212644e-02,-4.04314548e-02,-1.74297199e-01,1.23823266e-02,6.56381771e-02,-1.50357515e-01,2.32690889e-02,-1.06683932e-01,-2.12385312e-01,7.78871998e-02],[-4.40680794e-02,9.38347504e-02,-1.77910149e-01,9.81381983e-02,1.52499244e-01,-1.80228055e-01,-1.69439808e-01,7.29804905e-03,-1.42229438e-01,-2.11042792e-01,-1.35270506e-01,-1.20960526e-01],[-1.45215869e-01,1.05002195e-01,1.42783716e-01,-1.21777326e-01,1.40720412e-01,-7.67044425e-02,1.26858046e-02,1.56196728e-01,-1.06535405e-02,-1.06225826e-01,2.83397846e-02,-1.31356850e-01],[1.34227306e-01,-1.09821158e-02,3.22328345e-03,-5.44706620e-02,-3.24112475e-02,-5.42474315e-02,-4.67159487e-02,-1.98181765e-03,1.44197583e-01,1.54926181e-01,-1.43529966e-01,-7.78222680e-02],[3.03951263e-01,4.51264940e-02,-3.99796888e-02,2.72582471e-01,2.22580105e-01,2.95254663e-02,1.02532782e-01,2.57163554e-01,5.67718688e-03,-1.73769414e-01,1.03003755e-01,2.03594133e-01],[-1.14150951e-02,-8.53678882e-02,4.46280725e-02,3.16927582e-02,-2.28194833e-01,1.49186417e-01,5.51247858e-02,2.59992070e-02,2.23779440e-01,1.01007603e-01,1.66802958e-01,-1.14652820e-01],[-4.13233370e-01,9.80017856e-02,-8.23071674e-02,2.43952930e-01,-4.51967090e-01,1.65224940e-01,-3.08235377e-01,-4.48004194e-02,-6.68148324e-02,2.68047333e-01,-3.76083702e-02,8.80552363e-03],[-2.75392085e-01,1.13233961e-01,3.09983790e-01,2.86291957e-01,-3.19243461e-01,1.11433685e-01,-3.18324268e-02,-2.84803838e-01,-3.71021181e-02,2.28317790e-02,-1.59344479e-01,3.03973369e-02],[-3.74478549e-02,-1.16117410e-01,3.12629014e-01,5.89712821e-02,1.71060562e-01,2.68818494e-02,-2.38080576e-01,4.17859927e-02,2.47686356e-02,-3.65157239e-02,-1.80642512e-02,3.14077079e-01],[-1.22957252e-01,-6.46465197e-02,5.62927267e-03,-5.92450321e-01,3.48093837e-01,5.26385242e-03,-6.59647211e-02,9.63157192e-02,-1.00135170e-02,-2.56373379e-02,2.71031886e-01,-1.23624220e-01],[-1.97438434e-01,3.17404442e-03,3.77082080e-02,-4.61807817e-01,3.19167495e-01,1.46109447e-01,1.29660770e-01,2.17030451e-01,1.47954807e-01,1.92527279e-01,3.87556143e-02,-2.18349889e-01],[4.91702817e-02,-1.94729581e-01,-1.05561234e-01,-3.79218012e-01,-1.09973803e-01,2.38269553e-01,2.79957116e-01,2.44466141e-01,3.84348065e-01,2.04738557e-01,3.67025912e-01,3.95012461e-02],[-1.56894580e-01,4.92136441e-02,8.50065723e-02,-1.06828906e-01,2.40882561e-02,3.25328857e-01,9.16529745e-02,-1.25405625e-01,2.38495618e-01,2.96355903e-01,1.15090549e-01,-5.14242500e-02],[-1.21733434e-01,3.02586257e-02,-7.41361231e-02,-1.50494933e-01,1.92649826e-01,3.71978842e-02,1.49294153e-01,1.60065919e-01,1.04553804e-01,1.60170689e-01,4.05593216e-02,5.89880086e-02],[3.98700237e-01,-1.42991930e-01,-3.17814231e-01,-9.61190015e-02,1.94723815e-01,3.28573823e-01,6.63315132e-02,9.96669605e-02,1.54875621e-01,-7.69686550e-02,-6.95029348e-02,-2.00770915e-01],[5.89084551e-02,1.45604789e-01,7.25288782e-03,1.40396059e-01,2.80874711e-03,2.58637182e-02,1.49068445e-01,-9.40769389e-02,1.41485557e-01,-1.57108948e-01,1.80294469e-01,7.95025602e-02],[-2.00911127e-02,3.77127491e-02,1.81056872e-01,5.06539978e-02,-1.83538459e-02,1.01368196e-01,-5.64534664e-02,3.44551615e-02,3.53248343e-02,-2.69746661e-01,-1.03859268e-01,6.03995807e-02],[-5.21326512e-02,5.74028231e-02,-1.79445371e-01,8.94565694e-03,2.07533464e-01,-1.34059489e-01,8.12111720e-02,1.46651611e-01,-1.08487681e-01,-4.36559707e-01,2.69847587e-02,1.21603057e-01],[-1.70724377e-01,1.53254732e-01,-6.22545145e-02,-1.59949079e-01,-1.20379571e-02,1.75017536e-01,8.57393369e-02,5.93124665e-02,-1.16495350e-02,-1.31343901e-01,-1.55249879e-01,2.66704075e-02],[4.16044071e-02,-3.42682033e-05,1.77704051e-01,1.09918572e-01,7.50240758e-02,2.49770626e-01,-3.51233631e-02,-7.85458907e-02,-6.29793331e-02,-3.49120498e-02,2.21249595e-01,-9.94812697e-02],[2.76498675e-01,3.63407344e-01,3.02410185e-01,2.80254394e-01,1.38306767e-01,-1.54283866e-01,2.31004432e-01,1.85771838e-01,6.83110282e-02,-1.86510459e-01,-9.60936323e-02,3.61171365e-02],[4.32932079e-01,3.15839448e-03,-1.21861234e-01,1.58139080e-01,-3.93391281e-01,2.00787783e-01,-9.71372798e-03,4.54204008e-02,2.31609821e-01,-3.29638332e-01,2.45553371e-03,-5.14960615e-03],[3.85015309e-02,1.64672658e-01,5.82481250e-02,1.43365592e-01,-4.60563041e-02,9.49738845e-02,1.49774039e-02,1.56803176e-01,8.69871750e-02,2.35542376e-02,-1.28139108e-01,1.14287734e-01],[-8.39113817e-02,6.34789765e-02,2.19416782e-01,5.03771752e-02,1.83419883e-02,-9.82561409e-02,-2.89393216e-01,-1.70096606e-02,2.04330191e-01,2.48530984e-01,4.70188558e-02,3.65155905e-01],[-2.44263947e-01,4.09500241e-01,1.18901096e-01,-1.68412238e-01,-7.93374144e-03,4.76945937e-02,-3.11928123e-01,-1.65639907e-01,-1.29612789e-01,1.62141591e-01,-2.00954471e-02,2.84392536e-01],[6.14388473e-02,-7.72170871e-02,-2.38825306e-01,-3.04074377e-01,1.65345848e-01,-6.60892725e-02,5.13577014e-02,1.34874940e-01,3.94830033e-02,3.52317058e-02,9.15413052e-02,3.71531062e-02],[3.37378323e-01,-1.46215439e-01,2.44123340e-02,-6.13111258e-02,-8.10285285e-02,1.62936732e-01,2.82833636e-01,-1.30626276e-01,3.35633636e-01,2.24729091e-01,3.00051212e-01,6.25901893e-02],[8.21327642e-02,-3.27881932e-01,-1.75462559e-01,-1.11362688e-01,-1.97968744e-02,2.40510434e-01,1.87634945e-01,3.01830828e-01,5.86390123e-02,-9.53070149e-02,1.31007373e-01,-6.42340407e-02],[3.08289826e-01,5.56662679e-02,-2.42774293e-01,1.42717719e-01,3.19222361e-02,6.62836209e-02,-1.04492247e-01,-1.56839445e-01,1.28877282e-01,3.08147609e-01,1.42659739e-01,-9.19559970e-02],[-5.60303517e-02,-2.38329738e-01,1.74132198e-01,4.84248064e-02,7.18930885e-02,-3.69092263e-02,2.21476126e-02,-2.73781456e-02,-2.68703257e-03,1.62670240e-01,2.49361038e-01,-1.32147267e-01],[3.00532192e-01,-2.80080676e-01,-1.39493063e-01,7.82433003e-02,-5.82865393e-03,3.22205722e-01,1.97939798e-01,1.67210639e-01,-2.94928998e-02,-1.66763291e-01,2.36570258e-02,1.53055519e-01],[-8.28283057e-02,-1.03364341e-01,1.41361400e-01,1.53640166e-01,4.51454610e-01,-1.25697881e-01,1.21350423e-01,1.24260478e-01,2.28088871e-02,-3.06938022e-01,1.53178930e-01,-7.53343925e-02],[-3.05625089e-02,-4.53173891e-02,2.44082436e-01,2.37613037e-01,-2.02541947e-01,-2.04454333e-01,1.02995954e-01,-7.60682523e-02,-2.39850715e-01,-2.06434950e-02,-7.66998157e-02,1.32317573e-01],[1.50607303e-01,-1.60669357e-01,2.62717128e-01,2.79530752e-02,1.56079605e-01,1.75066814e-01,-8.11378956e-02,2.29794625e-02,6.18166663e-02,1.52825251e-01,-1.97425812e-01,1.11716211e-01],[1.70303985e-01,5.38545884e-02,1.43370226e-01,-8.33803639e-02,2.21004635e-01,-2.58428846e-02,-1.82408132e-02,1.78148583e-01,5.95330782e-02,-4.23359200e-02,2.23480128e-02,-1.27667174e-01],[6.59907907e-02,-5.36836265e-03,1.42099112e-02,1.33898243e-01,-5.29956184e-02,1.63908407e-01,1.86018541e-01,1.37120351e-01,7.96993077e-02,-5.12791276e-02,-8.38385895e-02,2.11610883e-01],[8.61976966e-02,3.42071541e-02,1.01734929e-01,1.44127920e-01,-5.92097342e-02,-5.15433066e-02,1.62238851e-01,-1.81845471e-01,-1.59507960e-01,-1.61816433e-01,-6.00602776e-02,3.15160573e-01],[-1.22540183e-01,-7.91728795e-02,-1.77509096e-02,1.85890704e-01,-7.44611546e-02,2.48698905e-01,2.83007592e-01,1.61233962e-01,1.07195146e-01,-1.10354736e-01,1.10864230e-01,-4.05093506e-02],[-1.89303327e-02,1.73382089e-01,9.92968753e-02,-1.44166704e-02,-1.95075735e-01,4.55310233e-02,-1.31330967e-01,1.51812747e-01,1.26020595e-01,-1.23092802e-02,1.93127617e-01,9.97364074e-02],[-2.13271186e-01,2.26597562e-01,2.03748420e-02,5.16419560e-02,-7.57862851e-02,-8.48225132e-02,-2.95715481e-01,-2.24386767e-01,7.73446560e-02,-8.53403658e-02,-1.92538902e-01,1.89796969e-01],[6.21509412e-03,1.61353588e-01,1.76014453e-01,1.33614140e-02,5.01999669e-02,1.12284839e-01,8.50307122e-02,-9.12309140e-02,1.11366548e-01,-3.42489451e-01,2.74819527e-02,1.41775832e-01],[1.47384301e-01,2.19338551e-01,-2.74004579e-01,-2.04139322e-01,1.51838928e-01,1.93860441e-01,-5.04944623e-02,-1.06406450e-01,3.82879041e-02,-4.50364426e-02,9.31416899e-02,1.77778080e-01],[1.82928234e-01,2.30334923e-01,-7.76613876e-02,-1.42431259e-01,-1.23211183e-02,1.44358218e-01,2.76733786e-01,1.79923803e-01,5.43205403e-02,-2.41299883e-01,-1.28900379e-01,-9.91681069e-02],[3.47147316e-01,-3.11131869e-02,-1.26285732e-01,-7.30555058e-02,-7.13768154e-02,7.31234476e-02,3.21028233e-01,1.11444950e-01,1.45771056e-01,4.01587375e-02,1.00624956e-01,-9.47448686e-02],[1.34910569e-01,1.87264428e-01,1.20853245e-01,-9.59531888e-02,1.93246245e-01,1.86417937e-01,-1.23554692e-01,6.38851672e-02,-9.81018618e-02,7.31548071e-02,-1.23162277e-01,-3.38736288e-02],[-1.08854838e-01,-1.74881801e-01,-1.33284688e-01,2.72420160e-02,6.30988032e-02,1.45026490e-01,-3.18778157e-02,2.15006277e-01,-1.25185445e-01,7.66496286e-02,-1.78713694e-01,-6.47529867e-03],[1.15848176e-01,6.59303218e-02,3.44097279e-02,2.02878229e-02,4.07085083e-02,1.12239093e-01,1.55423701e-01,3.46117909e-03,8.18888843e-02,-1.74582586e-01,4.52263057e-02,4.81825024e-02],[-1.71408374e-02,1.15913741e-01,2.24502534e-02,1.49856597e-01,7.09012300e-02,2.69143283e-01,2.18597099e-01,2.87284285e-01,2.13331521e-01,-1.85091645e-01,5.40540442e-02,1.66171998e-01],[-1.06270328e-01,2.64817536e-01,-9.37069580e-02,2.31001019e-01,1.88662931e-01,1.36474133e-01,-8.69572237e-02,-3.70934159e-02,-6.24547154e-02,-1.38626546e-01,1.15812317e-01,1.72065064e-01],[1.30416472e-02,2.83540398e-01,2.96934783e-01,1.02758966e-03,-1.71897888e-01,5.63217551e-02,-2.54002482e-01,-9.38524678e-02,-1.21431813e-01,1.30650714e-01,-1.31005287e-01,1.54840678e-01],[8.58924165e-02,6.30282909e-02,1.03740737e-01,-1.07118949e-01,-1.42240852e-01,-1.05765311e-03,1.50206938e-01,-1.10495433e-01,-4.98102866e-02,-5.48462234e-02,1.48566470e-01,2.19583690e-01],[1.78151563e-01,-1.41203031e-01,1.19380206e-01,-4.89453152e-02,-4.46178950e-02,2.15038851e-01,-3.35351862e-02,-1.52506419e-02,-1.51905850e-01,-1.56489164e-01,-2.33127438e-02,-1.68665320e-01],[-2.59299487e-01,3.15777123e-01,3.30289096e-01,-2.15492681e-01,1.53165311e-01,2.95065232e-02,1.65516753e-02,1.14710994e-01,-1.52872682e-01,1.22975707e-01,-1.72079846e-01,3.33491247e-03],[1.62832171e-01,-8.70003477e-02,1.46510750e-01,-2.14164227e-01,-4.77091633e-02,-2.43247040e-02,1.25251904e-01,4.63449173e-02,1.16482198e-01,1.40532702e-01,-3.30176540e-02,5.64164631e-02],[2.30502300e-02,2.34333411e-01,9.02509913e-02,-2.91819543e-01,-3.04413080e-01,-4.87291291e-02,-3.86103168e-02,1.26063406e-01,1.21407121e-01,-1.15472898e-01,5.69071509e-02,1.84850201e-01],[2.18957812e-01,7.57306069e-02,-6.85982555e-02,-3.06663513e-01,1.32506832e-01,-5.69528155e-02,1.71534345e-01,7.54865864e-03,2.40316510e-01,-2.25619331e-01,-1.62260875e-01,1.25410736e-01],[-1.14221588e-01,5.81476465e-02,1.95944041e-01,-2.46096283e-01,6.89158738e-02,-4.68946286e-02,2.43651509e-01,3.87754180e-02,-1.07973460e-02,-5.97816631e-02,2.23182350e-01,-9.15673748e-02],[-8.62611830e-02,1.18444219e-01,-1.45933777e-01,2.06743523e-01,2.90417764e-03,-1.39204592e-01,2.89875939e-02,-7.22875772e-03,-1.66153774e-01,1.01083539e-01,-1.24308527e-01,1.61675721e-01],[1.81881592e-01,1.34697417e-02,-1.67712048e-01,-2.13738307e-01,5.45877479e-02,-8.20800811e-02,1.41908780e-01,-1.06906101e-01,1.70574710e-01,-2.39547476e-01,-4.75033112e-02,8.14154148e-02],[-8.76184180e-02,-2.12590750e-02,1.07564852e-01,5.88336289e-02,-1.56796932e-01,3.14504020e-02,-3.28758024e-02,2.09861442e-01,6.50880532e-03,-2.36576289e-01,1.59029976e-01,-5.78554422e-02],[-1.37481123e-01,1.89380839e-01,-1.61024228e-01,-1.81397587e-01,2.44077563e-01,7.18537569e-02,1.21720105e-01,2.60639906e-01,6.31775633e-02,-8.71931762e-02,6.47015721e-02,-1.80808172e-01],[-1.10932074e-01,2.25801721e-01,-1.32372931e-01,3.44595686e-02,-7.70556256e-02,-3.66509967e-02,1.47834942e-01,-2.37355918e-01,-1.41158938e-01,6.79031340e-03,2.37930063e-02,-1.64893363e-02],[-8.10517147e-02,2.94662379e-02,1.24779008e-01,2.82102413e-02,-1.69271782e-01,2.42763251e-01,-1.33491099e-01,1.66876361e-01,1.29547799e-02,1.61370814e-01,-1.54694617e-01,-3.00166057e-03],[1.90355942e-01,1.33289069e-01,-1.64813355e-01,-1.44941077e-01,2.41434872e-01,1.44326806e-01,-1.95227712e-01,1.16989255e-01,1.73638716e-01,-2.83718705e-01,-1.52360067e-01,-9.72280875e-02],[2.05092177e-01,1.00138582e-01,3.73223163e-02,7.10899010e-02,-5.13966084e-02,1.71260074e-01,-1.57255605e-01,-7.31929615e-02,1.85417935e-01,-1.15986265e-01,-3.78419608e-02,-5.21868356e-02],[-1.41747594e-01,1.01268843e-01,-9.35627744e-02,1.04786031e-01,-2.90073901e-01,-3.86830457e-02,-9.20206774e-03,-1.88380778e-01,-1.38789536e-02,1.62056834e-01,1.28520846e-01,1.46924764e-01],[9.64030400e-02,8.52443837e-03,-5.26412688e-02,-2.68287733e-02,4.43439707e-02,-1.93562417e-04,4.54956219e-02,-1.62427723e-01,1.45279795e-01,-2.24292263e-01,1.21207155e-01,1.26109973e-01],[8.57952312e-02,-1.62392646e-01,-2.54531018e-02,1.34275500e-02,-6.49445355e-02,-9.89314355e-03,-3.36394906e-02,2.61975676e-01,6.99261948e-02,-8.16385150e-02,-5.31573258e-02,-2.00114757e-01],[6.93330541e-02,2.55142570e-01,-1.06508434e-01,-4.85399306e-01,3.53967726e-01,1.97720721e-01,-5.35792150e-02,1.03842102e-01,-5.50794750e-02,3.58418338e-02,1.67985931e-01,-5.55812158e-02],[-1.87405214e-01,-1.49159655e-02,1.37586877e-01,-5.21194488e-02,1.30518481e-01,-1.10049739e-01,-8.48518685e-02,1.05462700e-01,-1.01069622e-01,2.01244026e-01,-1.44542426e-01,5.53654414e-03],[6.49743229e-02,-1.73481070e-02,-8.75578448e-02,8.40502046e-03,-8.55949223e-02,-9.35607255e-02,1.35292888e-01,5.01889028e-02,1.25616416e-01,-2.65425414e-01,8.57237428e-02,1.86133966e-01],[-4.94422615e-02,-2.27939263e-02,-2.62498260e-01,-1.20198037e-02,2.73603767e-01,-7.73352012e-02,-1.32786304e-01,9.92481248e-04,1.50989309e-01,-1.06613204e-01,3.88869494e-02,1.95009664e-01],[-1.66665718e-01,-8.81840810e-02,1.62480280e-01,8.65027383e-02,-4.50421944e-02,-2.85644904e-02,-9.14004967e-02,-9.18589067e-03,1.50019363e-01,-1.72894880e-01,-4.27378751e-02,1.95941895e-01],[-2.34617338e-01,3.07096392e-01,1.41527012e-01,-1.92694172e-01,1.69928759e-01,-1.96825504e-01,-1.35291025e-01,9.68835801e-02,1.18455365e-02,-4.34103981e-03,-3.30909640e-02,2.05484644e-01],[-8.99882838e-02,-1.08562194e-01,1.26326069e-01,-5.49939983e-02,1.80840999e-01,-7.45705366e-02,6.24163076e-03,1.93330675e-01,-8.26668441e-02,-8.44193250e-02,-6.19009137e-02,-1.56444106e-02],[1.49838805e-01,1.32693931e-01,7.97536373e-02,1.07611805e-01,8.62790048e-02,-1.05899230e-01,1.95404571e-02,1.79186791e-01,1.74422398e-01,6.35861009e-02,5.77469394e-02,-7.94934332e-02],[-2.53515691e-01,-1.22422062e-01,7.17289597e-02,1.26479164e-01,1.51392981e-01,1.03230532e-02,1.13166690e-01,2.33414606e-03,-1.24750189e-01,-6.71586394e-02,-1.00599537e-02,-4.82318690e-03],[6.55065775e-02,-2.66906079e-02,2.02062115e-01,3.04926276e-01,-1.39545932e-01,-7.18946010e-02,8.43387395e-02,-1.75457016e-01,1.28893316e-01,-6.62579015e-02,-2.46970043e-01,-5.30063361e-02],[-1.15126617e-01,4.61021587e-02,-1.98678747e-02,-1.73599273e-01,9.47329924e-02,1.71157375e-01,2.17010319e-01,1.00586444e-01,-4.16345857e-02,-1.60076410e-01,-1.13931790e-01,-2.06630483e-01],[1.24264009e-01,-9.28403139e-02,-1.53818727e-01,1.23330697e-01,6.59830570e-02,1.78052764e-02,-3.14918943e-02,-1.07281789e-01,3.48022506e-02,-1.89361379e-01,-3.81753705e-02,3.05433571e-03],[-2.23246560e-01,1.08738877e-01,-6.09561615e-02,9.84927043e-02,6.37344569e-02,-6.47336841e-02,1.27327368e-01,9.01958048e-02,1.90512910e-01,-1.33864716e-01,-1.54844876e-02,2.22840399e-01],[-5.84119046e-03,-1.08419947e-01,-7.67595023e-02,1.27619907e-01,8.30787886e-03,-6.48344904e-02,5.15327156e-02,-1.90994650e-01,1.22413924e-02,-1.72597602e-01,-1.78825736e-01,-3.69884111e-02],[-5.97957484e-02,-5.16469497e-03,4.61087860e-02,1.63839474e-01,8.74527395e-02,-1.08088635e-01,-1.16200872e-01,-9.98395309e-02,1.47109896e-01,1.75345764e-01,9.54224840e-02,2.62334459e-02],[2.49743044e-01,5.23341075e-02,9.72894579e-02,6.65683523e-02,3.04385424e-02,6.05203919e-02,-1.10029511e-01,-4.79650730e-03,5.83557449e-02,-2.66606301e-01,-1.16553977e-02,-6.30287901e-02]],dtype=np.float)
b0=np.array([0.20976096,-0.04962333,-0.02581057,-0.05174313,-0.08515619,0.25901756,0.17089307,0.02367241,0.18702284,0.17247067,0.12180006,0.0110681],dtype=np.float)
z1=np.dot(input_data,w0)+b0
a1=_relu(z1)
return a1
def _layer_one(input):
w1=np.array([[-0.2869829,0.49936584,-0.3304323,0.06629702,-0.20466682,0.91446155,0.5552365,-0.7370109],[0.18920976,-0.5092444,-0.28084636,-0.44575545,-0.40435132,-0.14687157,-0.20119005,0.62166077],[0.06386591,-0.07859889,-0.22007199,-0.08100863,-0.33824995,-0.6337715,-0.23346993,0.96303356],[0.8126793,-0.31568807,-0.20590363,-0.14630575,0.15897414,-0.695171,-0.7473887,0.58570516],[0.15695478,-0.74753106,-0.3281877,-0.7391342,0.40028682,0.15088986,0.09051634,-0.26052514],[0.26351067,0.45630106,-0.4931773,0.0554491,-0.6418681,0.606632,0.50009197,0.3457684],[-0.4217268,0.37106997,-0.00244503,0.30324182,-0.05322583,0.06064797,0.7162733,-0.12078427],[-0.18803366,-0.24210905,-0.29715398,-0.01992992,0.19337863,0.51569986,0.31774595,-0.5008903],[0.09155359,0.07087095,-0.5513608,0.23573382,-0.4828722,0.5701719,0.4060024,0.54517764],[-0.55468464,1.063522,0.39539593,0.8171174,0.15701714,0.23522702,0.97429836,-0.07571346],[-0.40735996,0.30021647,-0.34817776,-0.01962602,-0.48373425,0.33069637,0.24029556,0.22653876],[0.74467254,-0.22513321,0.11010721,0.32339144,0.40810695,-0.61086184,-0.5148591,0.74665636]],dtype=np.float)
b1=np.array([0.28241503,0.24006824,-0.02922342,-0.01879645,-0.05264836,0.09707203,0.14983825,0.17849602],dtype=np.float)
z2=np.dot(input,w1)+b1
a2=_relu(z2)
return a2
def _layer_three(input):
w2=np.array([[0.8823661],[-1.1978763],[0.74761945],[-0.8012815],[-0.24907705],[-1.0715413],[-0.73516214],[0.44261497]],dtype=np.float)
b2=np.array([0.15408769],dtype=np.float)
z3=np.dot(input,w2)+b2
return _sigmoid(z3)
def predict(input_data):
a=_layer_zero(input_data)
b=_layer_one(a)
return _layer_three(b)