-
Notifications
You must be signed in to change notification settings - Fork 0
/
yes_model_min.py
29 lines (29 loc) · 25.8 KB
/
yes_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([[-7.61112124e-02,4.17372352e-03,-2.88709961e-02,-9.98222008e-02,3.57228398e-01,-1.97849110e-01,-1.95554182e-01,7.91458711e-02,-1.88918740e-01,-4.03471254e-02,-1.19863980e-01,-2.06972323e-02],[-2.81994492e-01,-2.37183925e-02,-3.83828163e-01,-1.68631092e-01,7.67200142e-02,-2.08643094e-01,-2.27881178e-01,-1.77109525e-01,-1.10722609e-01,-2.76989490e-01,-2.46479690e-01,-9.40366611e-02],[-1.07054561e-01,1.07524976e-01,7.70086348e-02,1.82658225e-01,4.74974997e-02,2.27093875e-01,-5.81278913e-02,-6.20693266e-02,3.06330482e-03,-1.12597365e-02,-5.97939007e-02,-1.03424676e-02],[2.24220246e-01,-9.32385027e-02,1.18582331e-01,3.40451270e-01,2.52770800e-02,1.96188733e-01,3.25094879e-01,1.43494442e-01,-1.46675795e-01,2.93649912e-01,7.67850429e-02,2.99175512e-02],[1.79142997e-01,7.51023665e-02,1.96316034e-01,2.84412742e-01,-7.90214315e-02,9.08477604e-03,2.37653017e-01,-1.97127834e-01,-9.48660672e-02,-3.01951934e-02,2.88289860e-02,4.83069755e-02],[1.69888109e-01,-8.37777928e-02,-2.40450546e-01,2.75522768e-01,1.51522055e-01,6.02699677e-03,1.12581288e-03,-1.57974631e-01,-3.46071497e-02,1.90543413e-01,1.20634668e-01,-9.98358279e-02],[-1.05921574e-01,-3.22985835e-02,1.31440535e-01,3.80012065e-01,-7.23386034e-02,-4.14493158e-02,-1.19337812e-01,-1.12640820e-01,4.11481187e-02,5.42160384e-02,1.34143636e-01,-1.34831011e-01],[4.92170975e-02,-3.73338386e-02,-2.29159191e-01,1.37712568e-01,2.73860376e-02,-5.58822714e-02,-1.52483165e-01,1.46920308e-02,-3.43149938e-02,-2.74824381e-01,-6.22484684e-02,-1.39968529e-01],[2.25974590e-01,8.39661434e-02,1.62548825e-01,1.16550989e-01,1.58254579e-01,-3.07007618e-02,6.70202896e-02,-3.85020375e-02,-1.97871447e-01,1.30261555e-01,-1.89028844e-01,1.49246678e-01],[2.20076993e-01,3.27484719e-02,8.01391453e-02,7.66726583e-03,-1.77275136e-01,1.81044564e-01,5.20728156e-02,-1.03145838e-01,2.88931131e-02,-1.66258737e-01,2.22069189e-01,1.08987413e-01],[3.12679619e-01,-9.46736410e-02,-9.41528454e-02,-1.53909743e-01,-5.94927929e-02,-5.17465584e-02,8.73784274e-02,-5.76447882e-02,5.42754568e-02,-1.81477126e-02,-1.35131078e-02,1.09054990e-01],[1.12475790e-01,-3.14105421e-01,6.27802163e-02,-2.65171379e-01,-1.38570853e-02,-6.72486946e-02,-1.36688545e-01,-2.13842437e-01,-7.01503307e-02,8.62760693e-02,-3.44477668e-02,-2.04076841e-01],[1.22340389e-01,8.56022984e-02,2.85106599e-01,7.77772889e-02,-1.18722944e-02,-1.93859622e-01,2.96205003e-02,-2.00524464e-01,-1.65430307e-02,-1.22511685e-01,1.05617613e-01,-7.00076669e-02],[-1.88491896e-01,6.49654195e-02,5.93844652e-02,-2.53018574e-03,7.67664611e-02,-1.70570835e-01,1.54208153e-01,-1.46032209e-02,1.16261624e-01,2.76371446e-02,1.75930664e-01,7.17002302e-02],[1.39465202e-02,-8.88184756e-02,6.63036704e-02,-1.61812473e-02,-3.99977230e-02,2.22101837e-01,-1.22070052e-02,5.09350002e-02,1.56464800e-01,-8.62007961e-02,-6.31061383e-04,-1.38900340e-01],[2.02813312e-01,-2.34112695e-01,-8.51828828e-02,1.01706512e-01,-6.91643432e-02,5.89524098e-02,-1.39665380e-01,5.68916388e-02,9.88352299e-02,-1.23415917e-01,1.51193812e-01,-1.58437192e-02],[3.90965305e-02,-3.09201151e-01,4.55075093e-02,9.65153873e-02,1.18663460e-01,2.23914877e-01,1.38225004e-01,-3.23791839e-02,-2.19965905e-01,-5.08512110e-02,-2.83849150e-01,4.02231738e-02],[-2.54610538e-01,-2.31531456e-01,-8.18004534e-02,9.39603802e-03,2.56131738e-01,9.59355235e-02,-3.95799309e-01,-3.25305432e-01,-6.98757023e-02,-2.16554657e-01,-4.78710920e-01,8.39276984e-02],[3.94125618e-02,-1.25634179e-01,2.83304960e-01,1.63177103e-01,2.01454654e-01,1.44521385e-01,1.45092621e-01,4.40532640e-02,-4.31873165e-02,1.65865526e-01,3.42457257e-02,-1.03795476e-01],[1.17009226e-02,-1.38185456e-01,1.12871282e-01,8.22629407e-02,2.36608922e-01,1.96900740e-01,-9.10000596e-03,-1.00929044e-01,2.54351348e-01,1.21791989e-01,1.64711978e-02,-1.46532550e-01],[2.70402431e-01,-1.76089257e-01,1.41783789e-01,4.25084442e-01,-1.95781663e-01,2.69114166e-01,2.32648090e-01,-1.71323828e-02,3.86673608e-03,3.00210044e-02,-6.10924996e-02,-1.35343015e-01],[-1.90804452e-01,-2.21093848e-01,-1.05846867e-01,4.96036053e-01,-1.49161398e-01,4.55948055e-01,-1.19975349e-02,5.99649251e-02,1.18908621e-01,4.29194778e-01,3.26609999e-01,-1.75665960e-01],[4.12890874e-02,-2.50952631e-01,-5.73883690e-02,1.56791747e-01,-1.55286938e-01,2.01298207e-01,2.93655753e-01,3.44949514e-01,-7.69721791e-02,2.39075422e-01,2.05830693e-01,1.43098295e-01],[-1.92030102e-01,-2.81373356e-02,-2.60894056e-02,-1.84004270e-02,2.37246215e-01,1.36882231e-01,-2.04719722e-01,4.19154130e-02,9.03274268e-02,-7.18544647e-02,6.48954883e-02,-1.45355657e-01],[2.10507233e-02,-4.82093496e-03,-1.92964464e-01,-2.17383564e-01,1.02183893e-01,-4.27378528e-02,-1.96374133e-01,1.82642251e-01,1.05334565e-01,-1.27819613e-01,9.35240313e-02,1.95216462e-01],[6.05606809e-02,1.51554152e-01,-1.91797409e-02,-2.19756886e-01,3.82057816e-01,-1.74988821e-01,1.48052484e-01,-2.35403225e-01,-2.39828750e-02,4.73245941e-02,1.50806010e-01,4.64486741e-02],[-1.07198186e-01,-6.91393018e-02,-6.34186938e-02,-1.08972147e-01,-4.55366448e-02,-2.38903865e-01,-6.46644905e-02,-2.32184902e-01,-2.47863397e-01,-2.62196139e-02,7.94947669e-02,1.23964325e-01],[1.61327451e-01,1.48821533e-01,-1.88694075e-02,-1.49354875e-01,-6.17013946e-02,-1.41772896e-01,3.00798193e-02,-1.06777929e-01,-2.95510173e-01,-2.02624455e-01,2.26755172e-01,-7.62101784e-02],[-2.07117602e-01,3.06184627e-02,-8.95709395e-02,-1.37097135e-01,6.78111464e-02,-2.26785809e-01,-1.14825033e-01,1.72880694e-01,-9.06332978e-04,-2.88962215e-01,2.63778746e-01,1.74677655e-01],[2.85225004e-01,8.49848464e-02,6.40118644e-02,6.28781971e-04,4.27785069e-02,9.13113654e-02,-5.42987138e-02,2.35505551e-01,1.51756063e-01,9.54537839e-02,1.65880546e-01,8.27123076e-02],[-1.58706218e-01,9.08489302e-02,-1.35809436e-01,1.40852973e-01,2.13814273e-01,1.02284864e-01,-6.86897412e-02,2.39463095e-02,2.26679936e-01,-1.25418574e-01,4.20320928e-02,6.27809465e-02],[3.29527020e-01,-8.26749057e-02,1.09900594e-01,-4.01972979e-03,-3.16153347e-01,1.69003755e-01,-2.33861897e-02,6.35247380e-02,8.38537365e-02,-1.63205907e-01,3.65813047e-01,1.03922561e-01],[4.08595391e-02,-1.97975844e-01,1.44582212e-01,2.42520142e-02,1.12409182e-01,4.97430079e-02,-3.34658176e-01,-9.49030668e-02,-1.02416717e-01,-1.77830569e-02,8.51123035e-02,-2.01964248e-02],[-2.34920025e-01,-4.07908052e-01,2.09411427e-01,1.75759181e-01,-8.87549818e-02,7.40751475e-02,-3.53153467e-01,8.40403959e-02,-7.77024552e-02,9.08722952e-02,-1.65374696e-01,-5.80166057e-02],[1.74515203e-01,-3.51790845e-01,-1.52655905e-02,5.23380302e-02,3.50063235e-01,2.37443507e-01,2.89775226e-02,7.51889944e-02,-2.39873543e-01,3.26303318e-02,4.18810040e-01,-1.39689356e-01],[-9.84995067e-02,-3.94123346e-02,1.75829396e-01,1.19599260e-01,1.07831977e-01,1.21126339e-01,1.55013487e-01,-4.27102074e-02,1.10039368e-01,1.57287851e-01,1.91853717e-02,-2.84214877e-02],[-5.63510805e-02,-1.11038819e-01,2.71899730e-01,5.08690655e-01,-1.93740785e-01,2.82015920e-01,2.38458693e-01,1.48145333e-01,1.23745270e-01,5.12413502e-01,1.21178534e-02,1.55547205e-02],[1.14509463e-01,7.85150528e-02,5.65667599e-02,3.39625090e-01,2.70896405e-02,-2.66254749e-02,3.17471981e-01,2.36932576e-01,8.59985054e-02,2.15832949e-01,3.22691798e-02,1.51800513e-01],[6.04544282e-02,-4.04527903e-01,-3.48158330e-01,-1.88767239e-02,1.87558755e-01,4.84806448e-02,2.45232552e-01,2.55915582e-01,-6.23101592e-02,9.36342627e-02,1.48180038e-01,-1.52308106e-01],[-2.56264985e-01,-6.56481609e-02,-2.20232740e-01,-4.36259627e-01,3.94279867e-01,-3.22032422e-01,-1.87057585e-01,6.52377009e-02,7.95268267e-02,-2.79037915e-02,-6.92851692e-02,-1.17283657e-01],[2.15190127e-01,7.68878460e-02,-1.80398285e-01,3.18327583e-02,1.13029443e-01,-2.15926394e-01,-7.29440302e-02,5.87941818e-02,8.99876282e-03,-1.36421397e-02,2.60156572e-01,-3.78968827e-02],[-8.40383209e-03,3.18970345e-02,-1.87797397e-01,-6.88919649e-02,1.47590032e-02,1.37325525e-01,-3.56673747e-02,-4.30438891e-02,8.52558911e-02,-2.31598824e-01,9.41511691e-02,1.23749778e-01],[-1.36299193e-01,-4.20795679e-02,3.17706317e-02,-1.37627691e-01,2.47687072e-01,-3.87550183e-02,-5.07117510e-02,-2.33603269e-01,1.90019663e-02,-2.29226183e-02,-1.45132588e-02,8.00071210e-02],[2.38605604e-01,1.68728694e-01,-8.90561030e-04,-2.70388603e-01,-1.46424621e-01,6.81015849e-02,-1.26765370e-01,-8.70168358e-02,-1.92167088e-01,-1.76098034e-01,4.36860248e-02,1.01607099e-01],[2.41704330e-01,2.34583452e-01,1.12113051e-01,-2.22593307e-01,-1.37268174e-02,-7.06235133e-03,-1.46263927e-01,1.13242283e-01,-5.00764651e-03,-3.59085947e-02,1.06680505e-01,3.24170515e-02],[-1.97263379e-02,4.98807356e-02,6.56190291e-02,-2.13048793e-02,1.03935510e-01,2.08988354e-01,-4.36153077e-02,5.36246561e-02,-4.23757464e-01,1.61982536e-01,2.44197711e-01,1.47616848e-01],[1.26252696e-03,-3.80337723e-02,-1.83219060e-01,-7.71059692e-02,7.46546239e-02,1.93413734e-01,-1.01775125e-01,2.73479164e-01,-6.48752078e-02,-2.01854974e-01,1.89450994e-01,-1.83626264e-01],[1.63611025e-01,-1.07393697e-01,1.23137400e-01,1.85722604e-01,7.87445754e-02,2.32029781e-01,-1.90954432e-01,-7.17997253e-02,-1.86383128e-02,-4.49487716e-02,8.47780779e-02,-2.15459108e-01],[2.60635197e-01,8.76271874e-02,-1.80259328e-02,4.30658553e-03,-2.47963369e-02,9.63527039e-02,7.69989192e-02,-1.43983245e-01,1.90859884e-01,-1.87434867e-01,8.71933401e-02,1.03314435e-02],[-2.36739606e-01,-2.38582969e-01,-1.37318879e-01,2.41041660e-01,2.94214755e-01,2.56268680e-01,-1.13319688e-01,2.78755516e-01,-2.54904240e-01,7.47732669e-02,2.59804487e-01,-1.61396727e-01],[-6.26457930e-02,1.98029518e-01,-1.42924879e-02,-2.37819124e-02,4.62578088e-01,-1.73637852e-01,2.87944645e-01,-3.23477000e-01,-5.81954539e-01,8.39320496e-02,-1.05426656e-02,1.91444203e-01],[1.12118691e-01,1.86153114e-01,4.71878909e-02,1.26996830e-01,1.25214964e-01,2.52499014e-01,1.39730304e-01,-9.10970345e-02,-2.33667314e-01,-4.85482551e-02,-1.60003483e-01,1.35036871e-01],[1.50991052e-01,1.94092587e-01,3.64287525e-01,1.96208373e-01,1.58703491e-01,3.92708659e-01,2.46547356e-01,-1.09323733e-01,-1.29991993e-01,2.80461848e-01,2.15830188e-02,3.48346680e-01],[2.02865247e-02,2.57387698e-01,2.52916187e-01,-1.94095960e-03,-1.20062999e-01,6.49338169e-03,2.24967539e-01,-5.62771000e-02,1.19923614e-02,-2.43638940e-02,-1.13179512e-01,-7.27984831e-02],[1.33186251e-01,3.16828907e-01,-1.77681237e-01,-4.39657606e-02,1.71794325e-01,-5.93245663e-02,1.14629194e-01,3.44258896e-03,-3.10341030e-01,1.02070250e-01,-1.24350779e-01,3.36493775e-02],[-1.92033619e-01,-6.05512876e-03,-4.32696670e-01,-4.01642472e-01,1.81784630e-01,-3.66736017e-02,-9.46189463e-02,1.86730623e-01,4.85252775e-02,-4.42589909e-01,-3.04499418e-01,-6.81815520e-02],[8.03742334e-02,1.12095177e-01,1.06015742e-01,-2.25649238e-01,3.70772667e-02,-1.33181825e-01,4.99390624e-02,1.73650645e-02,-4.27681834e-01,-1.38354465e-01,-2.88200136e-02,-3.92972201e-01],[-1.76450968e-01,-2.86072046e-01,-2.05648780e-01,-1.03889160e-01,3.29527096e-03,-1.45194679e-01,-3.79367232e-01,2.30111018e-01,-2.15379998e-01,-3.07146814e-02,6.34720773e-02,-2.39260092e-01],[1.31558999e-01,-8.42511803e-02,3.51310745e-02,1.73310395e-02,2.61393795e-03,1.00827783e-01,6.93799928e-02,5.86347841e-02,-3.20704505e-02,1.36048868e-01,5.54589145e-02,-1.65785655e-01],[5.22723459e-02,-1.76339652e-02,6.87464997e-02,-1.51172891e-01,4.76925075e-02,-1.32771969e-01,-2.82639235e-01,1.14664823e-01,-7.24157915e-02,-1.05370857e-01,1.43833876e-01,5.03491377e-03],[7.01081902e-02,-1.56186685e-01,-4.29640673e-02,-8.31756368e-02,9.51054096e-02,3.23537812e-02,-1.29327446e-01,-9.41661745e-02,-1.70467690e-01,1.50106877e-01,2.10069194e-01,-1.63160801e-01],[2.59487092e-01,9.74823087e-02,7.83434231e-03,2.95713674e-02,-3.59508842e-02,2.24305853e-01,6.79753497e-02,1.59934148e-01,-2.48994112e-01,-1.22521505e-01,7.17413751e-03,5.58061711e-02],[1.17764615e-01,2.31920704e-01,-1.11821897e-01,8.98959190e-02,-1.16458885e-01,1.84843279e-02,-8.15390423e-02,1.85639948e-01,-4.03442949e-01,-5.55223152e-02,-1.33099943e-01,1.54762983e-01],[1.12311706e-01,-4.66622822e-02,-1.51544616e-01,-1.10462397e-01,5.26978672e-02,3.17900814e-03,-1.76736400e-01,2.36848161e-01,7.28090294e-03,-1.04064673e-01,-1.46729812e-01,7.56392851e-02],[6.86162636e-02,-2.45518818e-01,-2.34489497e-02,2.16268390e-01,2.35540606e-02,2.53446996e-01,-5.32254986e-02,-4.09794413e-02,1.57893464e-01,1.08008541e-01,-8.69478881e-02,-1.36525899e-01],[-1.03013389e-01,1.49016842e-01,6.88228905e-02,3.04263413e-01,-1.25755578e-01,1.14542343e-01,-6.98047206e-02,9.48610306e-02,5.03764570e-01,1.87161952e-01,2.74024665e-01,2.07519799e-01],[-6.23464435e-02,1.17098421e-01,2.28303418e-01,-1.31173864e-01,4.43784803e-01,5.17130382e-02,2.56130751e-02,-3.95488054e-01,-5.59493266e-02,1.15600556e-01,-1.93240434e-01,1.70906886e-01],[6.13060556e-02,1.45017475e-01,4.24617603e-02,-1.32994935e-01,2.44725287e-01,-5.62073402e-02,-7.75692537e-02,-2.18928248e-01,-5.55326231e-03,1.05159683e-02,8.03572014e-02,4.91698608e-02],[9.48814228e-02,-6.35286868e-02,3.64646822e-01,-1.25479937e-01,3.63666490e-02,-1.76512040e-02,1.38039574e-01,9.36027020e-02,-2.12768704e-01,-5.08428179e-03,1.54812723e-01,3.22259098e-01],[1.67838231e-01,2.75633633e-02,2.52893537e-01,-3.28026563e-02,1.98250636e-03,2.62918323e-01,-1.07940398e-01,1.29404049e-02,-2.94733465e-01,-4.74059302e-03,-1.92482159e-01,3.75959009e-01],[2.50395387e-02,2.29031760e-02,-5.52780330e-02,4.99053188e-02,1.03574216e-01,-1.95395723e-02,-1.12388335e-01,1.11002147e-01,-1.36005849e-01,-4.40445878e-02,-3.96823317e-01,1.12040274e-01],[1.03084825e-01,-1.95929408e-02,-3.69477808e-01,-2.36561626e-01,1.11144215e-01,2.31344495e-02,2.14575827e-01,2.09701926e-01,-6.43068776e-02,-2.68830925e-01,-4.78288919e-01,-2.77433455e-01],[-1.46898642e-01,1.51804611e-01,1.56878009e-02,9.45587829e-02,-1.34764686e-01,-5.38906083e-02,2.43375778e-01,2.97542393e-01,-3.66104394e-02,-3.17656517e-01,2.46705059e-02,-4.57804859e-01],[8.30070227e-02,-2.95423687e-01,7.04498067e-02,-4.87302467e-02,-2.34066278e-01,1.77335665e-01,-2.80729651e-01,1.00589670e-01,-3.36554982e-02,-1.27971426e-01,-1.31734490e-01,-2.08876833e-01],[7.28027001e-02,1.12897195e-01,-1.99407153e-02,1.33215725e-01,2.20920563e-01,-1.04112186e-01,-1.94933668e-01,-7.44911283e-02,1.58067465e-01,6.87889680e-02,-1.12624608e-01,-1.99847773e-01],[-1.93733349e-01,-1.05259463e-01,1.04583269e-02,3.51873832e-03,-3.18995528e-02,1.44503966e-01,-2.24899933e-01,-1.83368549e-01,-5.49746267e-02,-2.35559270e-01,-1.81912422e-01,-4.66367453e-02],[7.19459131e-02,1.32911474e-01,-1.24936499e-01,1.24283314e-01,-4.00438569e-02,2.14826800e-02,6.45169383e-03,-1.66705325e-01,9.00287777e-02,-4.78783362e-02,-3.66764441e-02,7.66108371e-03],[-1.10022858e-01,5.66330142e-02,-1.27380475e-01,-2.14597657e-02,3.32371444e-02,-1.34708017e-01,-7.03250468e-02,5.38846441e-02,-2.18873750e-02,-3.66995744e-02,-2.08308116e-01,9.83057991e-02],[8.18566233e-02,-1.23568356e-01,-4.48185876e-02,-2.15077281e-01,4.77527976e-02,-1.05945572e-01,-1.80277318e-01,1.54863790e-01,-6.04640618e-02,-6.87231123e-02,-1.54537946e-01,1.75703261e-02],[5.46617582e-02,3.46109211e-01,2.55789787e-01,-2.50168025e-01,-2.09805872e-02,2.53217757e-01,-1.89851616e-02,2.09486708e-01,-2.03755915e-01,-1.93539280e-02,-1.32912010e-01,1.30528631e-02],[3.13879788e-01,-9.67355147e-02,-7.18734935e-02,-1.41416147e-01,-1.69916779e-01,3.09493661e-01,-1.04975164e-01,9.93787125e-02,9.70536023e-02,5.78668080e-02,2.35908795e-02,-1.74170583e-01],[5.52429957e-03,2.10511088e-01,2.61926919e-01,3.14897001e-01,2.66081840e-02,1.96126297e-01,-2.24106982e-01,1.16871737e-01,1.44256055e-01,1.79673582e-02,5.73078953e-02,7.84134269e-02],[8.76910146e-03,1.65389597e-01,2.09583923e-01,-2.51825273e-01,3.32394630e-01,2.24486947e-01,2.88398534e-01,-7.94333443e-02,3.54095936e-01,-6.54122904e-02,2.38143019e-02,3.74321290e-03],[8.56042132e-02,1.37365162e-01,1.95406049e-01,4.27210927e-02,1.69857949e-01,2.98714060e-02,1.12498440e-01,-2.75775492e-01,2.19943985e-01,4.00113054e-02,8.17556232e-02,8.95699784e-02],[5.58601543e-02,2.94948936e-01,2.94859231e-01,-1.33573756e-01,1.02930650e-01,3.19311082e-01,2.80424058e-01,-3.05581510e-01,-8.31315145e-02,7.57899880e-02,1.62201554e-01,2.12514967e-01],[7.75743574e-02,-1.19720437e-02,-1.06385633e-01,-2.16626793e-01,7.30386749e-02,7.87960738e-02,2.85365999e-01,-3.80170741e-03,5.75826131e-02,1.91897098e-02,2.00246423e-01,1.02567576e-01],[1.55077815e-01,1.50121510e-01,-5.01646437e-02,-4.64129522e-02,-4.13816199e-02,2.45133400e-01,4.95252721e-02,-3.13977629e-01,2.03086331e-01,-8.18789937e-04,-7.30532035e-02,1.04088888e-01],[-6.11891039e-02,-2.00354859e-01,-8.43256265e-02,-1.69975773e-01,1.36893198e-01,5.38954735e-02,-9.97884870e-02,1.56085312e-01,3.15011263e-01,-3.76471542e-02,-8.59110132e-02,-1.03913292e-01],[-1.01482905e-01,1.07185513e-01,-1.94376588e-01,-1.51377767e-02,-8.46279114e-02,-8.82016420e-02,1.03547178e-01,9.79691744e-02,6.80493265e-02,-8.61697346e-02,-2.42918819e-01,-1.26659900e-01],[1.50283545e-01,2.78416067e-01,1.34766757e-01,1.73743710e-01,-2.16762856e-01,1.66803673e-01,-2.84636505e-02,-5.50307184e-02,8.70283619e-02,-2.86612391e-01,-2.80753542e-02,-1.61025077e-01],[1.88505426e-01,-1.20472135e-02,9.84157398e-02,-5.13028689e-02,-1.21556155e-01,1.72731981e-01,-2.61551321e-01,2.02483162e-01,1.15373351e-01,-2.23602146e-01,-2.96150953e-01,-4.29956988e-02],[7.13069513e-02,8.05742387e-03,1.31402045e-01,2.58363336e-01,-1.12598836e-01,-2.21662074e-01,1.63464516e-01,2.75386591e-02,-2.92181879e-01,-1.26480788e-01,5.75256981e-02,-2.30129302e-01],[1.81824490e-01,-6.92653283e-02,9.17329267e-02,-5.73534369e-02,1.11108050e-01,9.29908380e-02,9.47146788e-02,-2.84420371e-01,2.28240564e-02,-2.32542172e-01,-1.39262706e-01,-2.38790959e-01],[2.89948702e-01,1.46618903e-01,1.83344677e-01,-2.43991762e-02,-3.00111443e-01,2.14342400e-01,2.70103645e-02,-8.54621604e-02,-1.49007559e-01,-3.84775251e-02,-2.18825355e-01,2.51629293e-01],[4.64085080e-02,3.04444462e-01,-1.63193449e-01,-1.79173976e-01,-6.15168065e-02,2.93540269e-01,-6.92769289e-02,2.38984317e-01,2.85683125e-02,-1.66291252e-01,-1.84257835e-01,2.15772450e-01],[-9.35672782e-04,-8.24906155e-02,-8.71079639e-02,-2.80399024e-02,2.47248616e-02,-1.86435521e-01,4.47437260e-03,-1.82408914e-01,-2.46606976e-01,5.08926287e-02,-2.34436858e-02,3.27502862e-02],[2.00957835e-01,-1.01152368e-01,1.80785805e-01,8.63846764e-02,3.81916836e-02,-1.14994384e-01,5.65144159e-02,1.34604961e-01,-1.55021101e-01,1.72839269e-01,4.10700291e-02,-1.51114939e-02],[-4.59101535e-02,2.07641780e-01,2.30761513e-01,1.59216616e-02,-1.00736260e-01,4.17013764e-02,-2.00846359e-01,6.78401515e-02,-7.25543737e-01,3.20413113e-02,6.83265328e-02,4.88496851e-03],[-8.01217258e-02,-2.35939901e-02,-9.03950334e-02,-3.80292743e-01,3.98701429e-02,-2.00548187e-01,2.48626158e-01,-1.47068411e-01,-2.18479514e-01,1.72414422e-01,-1.39007777e-01,7.74586722e-02],[-1.69083431e-01,2.06479579e-01,1.06918119e-01,-1.91308379e-01,-9.64683145e-02,-5.59310950e-02,1.93291362e-02,1.52537212e-01,5.43729030e-03,2.37485021e-01,-1.51091188e-01,-7.23019540e-02],[1.63149700e-01,1.35550708e-01,4.29035630e-03,-1.01882920e-01,8.15020204e-02,1.44025281e-01,3.68493907e-02,1.91335708e-01,-8.35495740e-02,9.27092060e-02,-5.32797119e-03,3.48999113e-01],[6.45840764e-02,2.01627821e-01,-1.71591684e-01,8.08662623e-02,-2.17762396e-01,2.47941643e-01,2.60946155e-01,-5.98196685e-02,-1.40487909e-01,1.97357848e-01,-6.20728135e-02,3.32850248e-01],[2.06613708e-02,-8.81431997e-02,-1.23009101e-01,2.56321020e-03,-6.18853010e-02,1.76168770e-01,-1.20736897e-01,-1.65292591e-01,-1.11665845e-01,1.00118458e-01,2.12829977e-01,2.78540462e-01],[9.33151990e-02,-6.32404685e-02,-1.16504766e-01,-2.32178301e-01,-9.36992280e-03,-1.08405210e-01,-2.23552622e-02,-8.33631530e-02,6.61328435e-02,-9.61136222e-02,-1.39626116e-01,-2.66766340e-01],[1.54750764e-01,-2.34580278e-01,-5.12131006e-02,-1.27407506e-01,-2.04165161e-01,-2.70528626e-02,9.55586135e-02,-1.75662309e-01,-1.94448978e-02,1.51874321e-02,-5.18437847e-02,1.24308504e-01],[5.28270286e-03,-9.34130698e-02,4.87112291e-02,2.63973355e-01,8.61666054e-02,5.15320115e-02,1.83286428e-01,-1.14099674e-01,-2.00522125e-01,-9.80022922e-02,7.08848387e-02,7.96955749e-02],[-2.00607572e-02,-1.95914641e-01,2.70044655e-02,9.86034796e-02,-3.79178748e-02,2.30177697e-02,2.49192188e-03,-1.76404551e-01,1.96002722e-01,-3.01802784e-01,-1.56743973e-01,-7.48674646e-02],[2.62983769e-01,-7.28673562e-02,1.45344198e-01,1.86909456e-02,-2.21208930e-01,1.71598986e-01,-1.24290220e-01,5.22484742e-02,9.24532488e-02,1.50355563e-01,2.52429873e-01,1.86478943e-01],[-1.23508282e-01,-2.15280596e-02,-3.33513349e-01,-3.52800451e-02,2.58059382e-01,-1.93674386e-01,1.68300718e-01,-1.62508011e-01,1.96549296e-01,3.46140675e-02,2.20366016e-01,-1.75715700e-01],[-2.44135246e-01,5.56935742e-02,4.80757430e-02,-6.42285869e-02,-5.31710424e-02,1.16694786e-01,-8.23825374e-02,-9.31693614e-02,3.62588130e-02,1.08808175e-01,-5.95027991e-02,5.60828019e-03],[1.31036937e-01,-1.34872928e-01,7.06507778e-03,4.58223112e-02,1.60608411e-01,-1.96986049e-01,-2.29249433e-01,-2.00864568e-01,3.12339246e-01,-1.73072591e-01,-1.01140708e-01,-1.25537053e-01],[1.53526738e-01,-3.96984592e-02,-1.66912198e-01,-3.70009929e-01,2.98427880e-01,-2.43653178e-01,1.51990414e-01,-1.73275888e-01,2.36863524e-01,4.13040310e-04,1.62606835e-02,-1.06410235e-01],[-1.60280272e-01,1.44864261e-01,-2.79606104e-01,2.10357253e-02,-5.74659184e-02,6.46269694e-02,-2.04767600e-01,3.73503380e-02,-2.65415758e-01,1.90380082e-01,-1.21358603e-01,1.49489328e-01],[2.07014419e-02,1.28565922e-01,7.49557391e-02,-3.25452656e-01,-7.83958733e-02,-7.32444003e-02,1.85078576e-01,1.60504073e-01,-8.77427086e-02,2.70726055e-01,-7.45602176e-02,-8.13371837e-02],[-1.70701221e-01,2.69877076e-01,-8.18289071e-02,6.28880598e-03,-9.88667905e-02,-2.29349941e-01,-1.21978141e-01,2.29004279e-01,-1.52084365e-01,6.89657852e-02,-2.39861593e-01,1.25425696e-01],[-1.81573138e-01,2.10647509e-01,-1.83332577e-01,-8.46277177e-02,-7.69980624e-02,9.73349363e-02,-3.96647304e-02,-1.07976802e-01,1.23910625e-02,3.95277180e-02,-2.05290318e-01,-3.31535153e-02],[-1.77061521e-02,6.14110306e-02,-1.41642779e-01,-4.39786911e-02,1.89657822e-01,1.83961123e-01,-2.87794098e-02,9.86790061e-02,-3.75759490e-02,2.28582114e-01,2.56425798e-01,1.47020668e-01],[5.57006821e-02,-1.68353375e-02,-9.02394503e-02,-3.29335332e-02,-8.29473436e-02,-9.30530503e-02,-1.19061247e-01,-1.20274372e-01,2.50895143e-01,1.00926958e-01,-9.47586447e-02,1.18071362e-01],[2.09563086e-03,-2.32401520e-01,-2.89357811e-01,-2.07735747e-01,1.44685596e-01,-4.46897708e-02,-3.46612162e-03,3.16811875e-02,-7.59063587e-02,-1.00421235e-01,-1.71756014e-01,-6.18428588e-02],[1.16295509e-01,-2.46834904e-01,9.90268365e-02,-1.60743251e-01,1.17415965e-01,2.58420706e-02,-1.16732389e-01,-9.35238451e-02,-2.02183470e-01,-2.33833920e-02,-1.08966880e-01,-3.10930997e-01],[-3.67394015e-02,4.59900685e-02,-3.63758355e-02,3.95543389e-02,1.37832001e-01,1.26787961e-01,-2.03840248e-02,-1.16463518e-02,4.07714695e-02,-7.16388822e-02,1.73801202e-02,-1.37505352e-01],[3.40161216e-03,-1.22372601e-02,-1.11974478e-01,-1.27516598e-01,2.42521744e-02,-2.27109622e-02,1.19394019e-01,2.32649386e-01,1.39360027e-02,-4.90869135e-02,-8.35171342e-02,2.66838372e-01],[2.92904750e-02,-3.65704775e-01,-1.58598885e-01,5.45422873e-03,1.04259634e-02,9.62880552e-02,1.26161978e-01,-7.17713311e-02,1.75073102e-01,5.50681129e-02,-1.81219190e-01,-1.83945745e-01],[1.47586554e-01,4.13506255e-02,-3.28443311e-02,-1.97696030e-01,6.61327913e-02,1.74855083e-01,-1.02819145e-01,7.77775869e-02,1.13211624e-01,-1.53906628e-01,-1.28352821e-01,9.83905271e-02],[-4.40487377e-02,9.41712856e-02,-1.90919206e-01,-1.33773789e-01,-1.87671795e-01,6.87265918e-02,4.47027534e-02,1.91201165e-01,3.03045303e-01,1.80354431e-01,-4.94761504e-02,-4.09923866e-02],[-4.89799529e-02,-6.72664791e-02,-2.51022071e-01,-1.42994866e-01,7.22182170e-02,2.90070660e-03,-5.69136553e-02,1.46834210e-01,1.16848573e-02,-6.78122193e-02,1.80828989e-01,-1.15000360e-01],[1.28908545e-01,-1.59609094e-01,-1.24675103e-01,-2.01870441e-01,3.33877541e-02,-9.16222706e-02,-9.92294997e-02,-2.11402595e-01,6.37478381e-02,-2.32648998e-01,8.27201754e-02,1.97147746e-02],[-1.81592368e-02,-8.87983069e-02,1.58201948e-01,-7.09462464e-02,1.16002612e-01,9.01877414e-03,1.42254129e-01,-2.80347429e-02,1.74436375e-01,-1.17538713e-01,-4.77275662e-02,-2.15567976e-01]],dtype=np.float)
b0=np.array([-6.9703087e-02,-1.4515671e-04,-2.5080740e-02,-8.6653113e-02,3.1750247e-01,1.1621542e-01,5.3288072e-02,4.2801246e-02,4.1285906e-02,-5.3254841e-03,-6.5613031e-02,8.8801607e-03],dtype=np.float)
z1=np.dot(input_data,w0)+b0
a1=_relu(z1)
return a1
def _layer_one(input):
w1=np.array([[-0.5801398,0.37769204,0.37809405,-0.24717931,0.11563622,-0.25186858,-0.63919586,0.31576687],[-0.21666908,0.5580129,0.42070875,0.55167425,0.18183447,0.9385317,-0.65536326,-0.05458922],[-0.54512554,0.20783952,0.77867997,0.11388333,0.67721295,0.41365,-0.47313258,-0.48754346],[-0.84670264,0.9559192,0.7561184,1.0073193,0.57274634,0.50831443,-0.9461864,-1.0413024],[0.82013226,0.09020517,0.09679506,-0.20612788,-0.03363921,-0.00135415,0.20121408,0.6914809],[0.14529973,0.13964415,0.08696514,0.31186566,0.36819813,0.2352645,0.5457378,0.45537654],[-0.9747818,0.57234675,0.72931165,0.34739783,0.9525267,0.60410994,-0.8495043,-1.2008456],[0.2028882,-0.20789772,0.59835464,0.71254015,0.07562512,0.6823455,-0.7240966,-0.17397189],[0.96710247,-0.63472927,-0.60146123,-0.44773296,-0.9477111,-0.7385757,1.1143273,0.32958677],[-0.6401787,0.24426389,0.11188699,0.49860278,0.40873092,0.44324496,-0.5178973,0.2686834],[-0.8883932,0.23574542,0.8664524,0.9909575,0.24973644,1.1387851,-0.4700223,-1.0952587],[-0.8596748,0.42395616,0.88151014,0.51238924,0.75031215,0.59053,-0.4049496,-0.660567]],dtype=np.float)
b1=np.array([0.4063363,-0.2084384,-0.223644,0.0244865,-0.13537137,-0.18678664,0.40600446,0.39345324],dtype=np.float)
z2=np.dot(input,w1)+b1
a2=_relu(z2)
return a2
def _layer_three(input):
w2=np.array([[0.8253177],[-1.2144302],[-0.96321017],[-0.9754526],[-1.0325733],[-0.591513],[0.6275896],[0.30383065]],dtype=np.float)
b2=np.array([0.29505387],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)