Wednesday, August 30, 2017

[Caffe] Try out Caffe with Python code

This document is just a testing record to try out on Caffe with Python code. I refer to this blog. For using Python, we can easily to access every data flow blob in layers, including diff blob, weight blob and bias blob. It is so convenient for us to understand the change of training phase's weights and what have done in each step.




import os import numpy as np import caffe caffe_root = '/home/liudanny/git/caffe' os.chdir(caffe_root) solver_prototxt = 'examples/mnist/lenet_solver.prototxt' solver = caffe.SGDSolver(solver_prototxt) net = solver.net # print out all the data flow blobs [(k, v.data.shape) for k, v in net.blobs.items()] [('data', (64, 1, 28, 28)), ('label', (64,)), ('conv1', (64, 20, 24, 24)), ('pool1', (64, 20, 12, 12)), ('conv2', (64, 50, 8, 8)), ('pool2', (64, 50, 4, 4)), ('ip1', (64, 500)), ('ip2', (64, 10)), ('loss', ())] # print out all the diff blobs [(k, v.diff.shape) for k, v in net.blobs.items()] Out[20]: [('data', (64, 1, 28, 28)), ('label', (64,)), ('conv1', (64, 20, 24, 24)), ('pool1', (64, 20, 12, 12)), ('conv2', (64, 50, 8, 8)), ('pool2', (64, 50, 4, 4)), ('ip1', (64, 500)), ('ip2', (64, 10)), ('loss', ())] # another way to get them # net.blobs['data'].data.shape # print out all the weights and bias [(k, v[0].data.shape, v[1].data.shape) for k, v in net.params.items()] [('conv1', (20, 1, 5, 5), (20,)), ('conv2', (50, 20, 5, 5), (50,)), ('ip1', (500, 800), (500,)), ('ip2', (10, 500), (10,))] # print out all the delta weights and bias [(k, v[0].diff.shape, v[1].diff.shape) for k, v in net.params.items()] [('conv1', (20, 1, 5, 5), (20,)), ('conv2', (50, 20, 5, 5), (50,)), ('ip1', (500, 800), (500,)), ('ip2', (10, 500), (10,))] # another way to get them # net.layers[1].blobs[0].data.shape # >> (20, 1, 5, 5) conv1 weights # net.layers[1].blobs[1].data.shape # >> (20,) bias # net.params['conv1'][0].data.shape # >> (20, 1, 5, 5) conv1 weights # net.params['conv1'][1].data.shape # >> (20,) bias # train net with one step containing net.forward(), net.backward() and update solver.step(1) # we can print out layer's weight and diff # for example: conv1 layer weight and diff net.params['conv1'][0].data array([[[[ 2.96188384e-01, 8.17541853e-02, 2.60872781e-01, 1.55013949e-01, 3.33202481e-01], [ 4.18642312e-02, -1.32216930e-01, 1.49550557e-01, 2.67668962e-01, -3.43341202e-01], [ -2.53422886e-01, -3.05163592e-01, 2.47497827e-01, -1.19671844e-01, 2.80767679e-01], [ -1.63359508e-01, 6.97551742e-02, -2.51729041e-01, 3.24277520e-01, -2.88177609e-01], [ -1.38477311e-01, -2.97245711e-01, 1.76042497e-01, 4.45310809e-02, 1.50566638e-01]]], [[[ -1.03693252e-04, 1.87090635e-01, -9.32983980e-02, -3.10818646e-02, -2.78589368e-01], [ 3.07356179e-01, 7.30967745e-02, -2.52113312e-01, 2.51423866e-01, 1.20526433e-01], [ 1.20661087e-01, -2.30771527e-01, 2.18085408e-01, -1.19358346e-01, -1.27717942e-01], [ -2.99442261e-01, -8.41691196e-02, -3.13840479e-01, -1.22352242e-01, -2.59424746e-01], [ -1.25171652e-03, -2.40717992e-01, 1.40515968e-01, -2.09675968e-01, -2.59756625e-01]]], [[[ 1.73345599e-02, -1.89618051e-01, 2.46704385e-01, -3.37535501e-01, -3.26149046e-01], [ 2.20306709e-01, -1.83119297e-01, -3.27513158e-01, -2.75321901e-01, -3.34838837e-01], [ -1.73406512e-01, 2.91747540e-01, -4.20536846e-02, 1.09703153e-01, -1.68849424e-01], [ -1.27955616e-01, -3.05365801e-01, -3.05906296e-01, -2.72641152e-01, 3.02119613e-01], [ -3.16173881e-01, 3.10881913e-01, -4.34017666e-02, -2.87459970e-01, -3.54013108e-02]]], [[[ -3.75115946e-02, 2.59860251e-02, -2.67563075e-01, -2.95373052e-03, 1.62017852e-01], [ -1.92272529e-01, 1.22951441e-01, 3.57700251e-02, -1.72895834e-01, 1.26651898e-01], [ 3.09104472e-01, -7.54711255e-02, -3.15282196e-01, -1.32043123e-01, 2.94216573e-01], [ -2.21778855e-01, -3.80586386e-02, 3.00420702e-01, -2.61840910e-01, -1.90241814e-01], [ -3.09005708e-01, -2.30036139e-01, 1.48775533e-01, -2.20361471e-01, 1.98022928e-02]]], [[[ -1.71283290e-01, 4.37907316e-02, 1.85218856e-01, 2.38706857e-01, 1.44751742e-01], [ 2.12188855e-01, -1.12473302e-01, 2.74003834e-01, -1.02753174e-02, -1.40307620e-01], [ 4.89063300e-02, 2.52039760e-01, -3.75117399e-02, -3.05377752e-01, -3.12741518e-01], [ -2.97015486e-03, -1.41999364e-01, -3.15778136e-01, -1.15270093e-01, -7.55272135e-02], [ 2.42260113e-01, -1.36959806e-01, -9.10708681e-02, 2.48399869e-01, 1.42992914e-01]]], [[[ -8.17231927e-03, 1.02883689e-01, -3.26424778e-01, -3.42627376e-01, -6.94921464e-02], [ -2.82334477e-01, -1.52208135e-01, -3.18699419e-01, -1.83698520e-01, -2.25590244e-02], [ -2.92171299e-01, -1.80642441e-01, 2.78954685e-01, -4.57928255e-02, -3.04147005e-01], [ -2.20040977e-02, 1.85244247e-01, 1.36712223e-01, -1.01917885e-01, -1.10127054e-01], [ -8.77017304e-02, 1.36303350e-01, -2.15394497e-01, -2.50151128e-01, 2.04128236e-01]]], [[[ 2.21986160e-01, 1.52486444e-01, 2.59585798e-01, -8.42478052e-02, -3.31176072e-01], [ -1.77442133e-01, -1.01652939e-03, 3.05052191e-01, -2.30043679e-01, -2.39638746e-01], [ -1.53573081e-01, 3.38667452e-01, 2.85393566e-01, -1.41598945e-02, -1.87376633e-01], [ -3.52574103e-02, -1.16832629e-01, -2.79286325e-01, -9.15041417e-02, 2.42731854e-01], [ 2.98322260e-01, 9.61515754e-02, -3.07517108e-02, -3.06372523e-01, 1.54536620e-01]]], [[[ 3.17714632e-01, -3.38928066e-02, 6.15296364e-02, 1.12748474e-01, 2.32884109e-01], [ 2.42434889e-01, -2.22345307e-01, -2.53018439e-01, -8.98867939e-03, 3.23690146e-01], [ -1.40180230e-01, -2.34752387e-01, -3.43095869e-01, 7.60297179e-02, -2.01449737e-01], [ 1.10458225e-01, -8.71616788e-03, -3.42768997e-01, -2.05386788e-01, -2.20129937e-01], [ -9.30635780e-02, 4.51287366e-02, -9.33430120e-02, -3.40381891e-01, 3.30208018e-02]]], [[[ -1.27021387e-01, -2.11306334e-01, 2.36106232e-01, 2.34317154e-01, -2.11229354e-01], [ 2.84021825e-01, 1.88918531e-01, -1.08223140e-01, 2.57796347e-01, -2.17522219e-01], [ 1.85428783e-01, -1.03087842e-01, -1.14888728e-01, -2.54142374e-01, 1.64029807e-01], [ -2.82339931e-01, -2.04701617e-01, 1.04681052e-01, -1.99871808e-01, 2.56874412e-01], [ 1.11895598e-01, -2.56512046e-01, -1.70507312e-01, -5.14733307e-02, -1.97425738e-01]]], [[[ 1.78583950e-01, -1.57235831e-01, -1.63503826e-01, -2.02170447e-01, -1.05300650e-01], [ 3.01029384e-01, -5.92590421e-02, 7.22105280e-02, -2.72923797e-01, 3.17600161e-01], [ -7.92729408e-02, 1.87620625e-01, -4.81152907e-02, -2.48313919e-01, -5.75303733e-02], [ -7.00364113e-02, 6.34532273e-02, -2.11333334e-01, 8.86419788e-02, 2.43188277e-01], [ 2.12838441e-01, 2.41051279e-02, -2.11891711e-01, 8.76103938e-02, -9.09928977e-02]]], [[[ 1.32029533e-01, 1.98487774e-01, -1.72664121e-01, -2.49538481e-01, 2.91088261e-02], [ 3.01238000e-01, 2.07095593e-01, 3.22910100e-01, 1.37930810e-01, -6.50059655e-02], [ 1.14995062e-01, 3.22943628e-01, -2.18466416e-01, -1.22566625e-01, -1.43869996e-01], [ -5.98511770e-02, -1.38338119e-01, 1.52852356e-01, -1.26804605e-01, 2.47966409e-01], [ -2.65582561e-01, 3.28833997e-01, 6.56944364e-02, -9.65876952e-02, 2.76953757e-01]]], [[[ -3.22500378e-01, -1.88984841e-01, 2.31040999e-01, -2.63955414e-01, 1.60245106e-01], [ -1.60762668e-01, 2.50005692e-01, 2.18327463e-01, 1.06796630e-01, 1.29343972e-01], [ 2.30747368e-02, -2.56869346e-01, -2.25156382e-01, 1.11634873e-01, -1.38058811e-01], [ 5.98259084e-02, -1.88583806e-01, -2.86670655e-01, -3.15665215e-01, -3.30382317e-01], [ 1.13051206e-01, -2.25136757e-01, 1.66614071e-01, -9.47718993e-02, -1.63494926e-02]]], [[[ -1.12255700e-01, 1.17856152e-01, 1.23964973e-01, 3.34218919e-01, -3.46381873e-01], [ -2.80466825e-01, 2.92388260e-01, 3.07486445e-01, 2.65165925e-01, 2.40838733e-02], [ -3.39540064e-01, 1.81145296e-01, -3.16693932e-01, 9.61970687e-02, -2.30983600e-01], [ 3.32338184e-01, -7.65162185e-02, 1.63890943e-01, 5.06507158e-02, 1.39559656e-01], [ -1.75476409e-02, 3.33137840e-01, -3.08156699e-01, -2.09410682e-01, 3.23408663e-01]]], [[[ 1.78443462e-01, 3.34512770e-01, -1.17481075e-01, -2.54398584e-01, -1.92102075e-01], [ 1.83695883e-01, 1.15942806e-01, 2.23183021e-01, 3.05289626e-01, 1.94937065e-01], [ 8.06113482e-02, -2.78294951e-01, -2.98268914e-01, 2.82136440e-01, 7.93794990e-02], [ -1.93067208e-01, 2.59172052e-01, -1.46951839e-01, -2.76824683e-01, -1.95874959e-01], [ -2.63507336e-01, 9.10674632e-02, -2.82116234e-01, -4.00853865e-02, 8.04499686e-02]]], [[[ 2.07312629e-01, 2.67094344e-01, 1.77325174e-01, 2.16630176e-01, -2.91104704e-01], [ 2.20196217e-01, 3.22374433e-01, 9.36645195e-02, 1.58202320e-01, -2.25961730e-01], [ -6.33315817e-02, -2.33432204e-01, 2.66489238e-01, 2.40643978e-01, -1.83223605e-01], [ 3.15313309e-01, 3.38441044e-01, 1.92414299e-01, -3.26478273e-01, 3.39733422e-01], [ -2.81069398e-01, -3.20405632e-01, -1.35856476e-02, 2.84756005e-01, 3.88162071e-03]]], [[[ -3.36188406e-01, 2.66918898e-01, -2.86128640e-01, -2.71160573e-01, -1.87272251e-01], [ 1.64753065e-01, 3.03545922e-01, 2.73392767e-01, 1.72278285e-01, 5.89272066e-04], [ -2.39020109e-01, -2.81241059e-01, 6.44257711e-03, 2.88311727e-02, -3.67828868e-02], [ 6.39253631e-02, 2.16404140e-01, 1.67808443e-01, 9.29857641e-02, 3.44589114e-01], [ 1.32412305e-02, 4.53333445e-02, 3.44428420e-01, 3.44234109e-01, 1.63846299e-01]]], [[[ -3.46962363e-02, 1.33117840e-01, -4.45341542e-02, -3.03478390e-01, -3.24575305e-01], [ 2.51780659e-01, -1.33497298e-01, 3.48222069e-02, -1.55265734e-01, 2.93246269e-01], [ 3.13326061e-01, 2.72570372e-01, 2.21889764e-02, -9.60574523e-02, 2.92419255e-01], [ -1.99070513e-01, 1.47602007e-01, 1.91086248e-01, -2.65758425e-01, -1.46234021e-01], [ -2.54741699e-01, -2.40734398e-01, -1.76828802e-01, -2.12204665e-01, 1.16735451e-01]]], [[[ 1.72821909e-01, -6.82904422e-02, -2.61117607e-01, 2.42607206e-01, -6.18754178e-02], [ -1.89559489e-01, 1.76110998e-01, 2.85906851e-01, -1.80097923e-01, -2.25503922e-01], [ 6.41914532e-02, -8.95706639e-02, -1.39370278e-01, 1.50192663e-01, 1.61251739e-01], [ 2.09373012e-01, 2.75615424e-01, 2.55711794e-01, -1.00430056e-01, -1.41101435e-01], [ -4.62415740e-02, -1.57726571e-01, 1.45692706e-01, -2.87341565e-01, -6.77316189e-02]]], [[[ 3.25993478e-01, -8.56771097e-02, 3.30270648e-01, -8.12956169e-02, -1.04799025e-01], [ -4.35245931e-02, -2.54303008e-01, 1.64027035e-01, 3.21989715e-01, -1.94608659e-01], [ -4.21537692e-03, 7.94539787e-03, -2.27484014e-02, 6.20181337e-02, 3.90370227e-02], [ -2.30889052e-01, 2.43471917e-02, -2.79232651e-01, 5.91451935e-02, 2.50940710e-01], [ 3.36866647e-01, 2.22805381e-01, 3.03205609e-01, -1.97744220e-01, 3.12978119e-01]]], [[[ 3.30980778e-01, 2.49156058e-01, 1.81421444e-01, -1.33866534e-01, 5.27709760e-02], [ 2.87995607e-01, -2.45092556e-01, -1.08064078e-02, 2.89197803e-01, 4.58094403e-02], [ -7.19141141e-02, 9.25352424e-02, 3.99480574e-02, -5.43273985e-02, -6.03595860e-02], [ -1.69756368e-01, 2.13161975e-01, 2.82242596e-01, -2.94464946e-01, 1.68023914e-01], [ 1.42150164e-01, 1.28166676e-01, -1.16839655e-01, 8.48759711e-02, -2.59753972e-01]]]], dtype=float32) net.params['conv1'][0].diff array([[[[ -7.70653969e-06, 5.09061556e-06, -1.47237333e-05, -1.12032823e-04, -1.64283367e-04], [ -2.22478429e-05, 1.45048934e-05, -6.05536188e-05, -1.38767806e-04, -2.31961996e-04], [ -6.18589547e-05, -6.13088778e-05, -1.08096952e-04, -1.74586065e-04, -2.18698973e-04], [ -3.14711506e-05, -4.26220140e-05, -6.99374432e-05, -1.26594401e-04, -1.05015090e-04], [ -4.89810518e-05, -3.96159012e-05, -3.52932111e-05, 4.73542087e-07, 1.55009584e-05]]], [[[ -1.50282140e-04, -1.24041311e-04, -4.29193096e-05, -3.47400237e-05, -5.14845451e-05], [ -1.82388787e-04, -1.11156995e-04, 2.31659833e-05, 4.52805252e-05, -4.93812113e-05], [ -9.10530289e-05, -1.60418695e-05, 2.53973922e-05, 3.59425540e-05, -4.70667073e-05], [ -2.69275133e-05, -4.27102459e-05, -6.04469506e-06, 3.78740424e-06, -1.12571900e-06], [ -4.88866208e-05, -7.73644497e-05, -6.68643625e-05, -6.19073398e-05, -5.78726394e-05]]], [[[ 1.17054522e-04, 1.41566023e-04, 1.90455437e-04, 1.02813967e-04, 2.15479631e-05], [ 5.37426749e-05, 1.23149977e-04, 1.57523027e-04, 7.04403501e-05, -1.57134473e-05], [ 6.63873798e-05, 5.07648219e-05, 9.51422044e-05, -7.23926496e-06, -6.59160505e-05], [ -5.64555157e-05, -4.68431826e-05, -2.20050279e-05, -8.21037684e-05, -9.84605940e-05], [ -1.15663148e-04, -1.40302145e-04, -1.16924726e-04, -1.37571420e-04, -1.19330369e-04]]], [[[ -4.21641962e-05, -1.04437131e-04, -8.96078127e-05, -1.38468924e-04, -1.93690474e-04], [ -3.88301814e-05, -8.04615629e-05, -5.66509807e-05, -7.91883067e-05, -1.45124344e-04], [ -1.68347688e-05, -4.62019052e-05, -5.17756816e-05, -3.55977172e-05, -1.46755658e-04], [ -4.20606084e-05, -7.14367707e-05, -5.58978209e-05, -8.51804216e-05, -1.75934387e-04], [ -7.39833122e-05, -1.12813745e-04, -6.34276948e-05, -1.18107353e-04, -1.99993869e-04]]], [[[ 1.34951799e-04, 5.15555475e-05, 5.32181230e-06, -7.10844834e-05, -1.14275710e-04], [ 1.04416395e-04, 2.86935356e-05, -1.61892822e-05, -6.85027044e-05, -1.12433307e-04], [ 2.06789373e-05, 9.02618012e-06, -5.68691758e-06, -6.11772484e-05, -1.36701739e-04], [ 1.16641997e-04, 8.58689818e-05, 2.09407717e-05, -3.59132791e-05, -1.38918011e-04], [ 2.55987048e-04, 1.74352783e-04, 8.72975579e-05, -9.25407585e-06, -1.55353177e-04]]], [[[ -4.33465793e-05, -1.24594619e-04, -7.92177452e-05, 1.41039618e-05, 1.62279866e-05], [ -1.22807587e-05, -7.20346652e-05, -2.99932217e-05, 1.66861319e-05, 2.15849668e-05], [ 3.53132164e-05, 3.05746325e-05, -9.77436139e-06, -7.08648849e-06, -1.80898933e-05], [ 1.04606472e-04, 4.17973934e-05, -8.34254661e-06, -9.99180775e-05, -1.32720263e-04], [ 9.03840919e-05, 6.11028736e-05, -1.14807544e-05, -8.04421870e-05, -5.09339297e-05]]], [[[ -8.66552364e-05, -3.19250321e-05, 4.56020607e-05, 9.46291548e-05, 7.10892782e-05], [ -7.93545041e-06, 7.70707484e-05, 1.34207454e-04, 1.04750427e-04, 5.46223455e-05], [ -3.84659252e-05, 1.02626131e-04, 1.22113197e-04, 8.44961469e-05, -7.95688084e-06], [ 2.72807702e-05, 1.25080580e-04, 1.18738048e-04, 3.24083921e-05, -4.32527413e-05], [ -3.99971359e-05, 5.52949532e-05, 9.45986758e-05, 5.67262614e-05, 4.68918688e-06]]], [[[ -1.47576400e-04, 1.19468359e-05, 1.80751900e-04, 1.94639040e-04, 1.69581574e-04], [ -1.50050444e-04, 7.28854211e-05, 1.40658478e-04, 1.54674766e-04, 1.88853883e-04], [ -8.17041146e-05, 3.37219353e-05, 7.60455732e-05, 1.03385406e-04, 1.58161536e-04], [ -8.70243821e-05, -5.40293513e-05, -4.25660328e-05, 7.06879437e-05, 1.63754041e-04], [ -1.15171773e-04, -5.33808707e-05, -2.63496549e-05, 4.77463509e-05, 1.80207528e-04]]], [[[ -4.75324960e-05, 4.58612813e-05, 1.37192808e-04, 1.59111572e-04, 1.40011805e-04], [ -1.03385801e-05, 8.16003158e-05, 1.20655546e-04, 7.56491354e-05, 4.44568723e-05], [ 1.93314354e-05, 5.48101234e-05, 3.18555176e-05, 2.14263073e-05, 8.85513691e-06], [ -1.25819015e-05, 2.19517915e-06, -4.11664723e-06, 2.02427236e-05, 2.59724293e-05], [ -6.98324293e-05, -6.74784460e-05, -2.97580482e-05, -5.02062358e-05, -5.10688842e-05]]], [[[ -1.58702765e-04, -1.51404995e-04, -1.31603621e-04, -3.35140066e-05, -3.34371907e-05], [ -1.88170015e-04, -1.23335543e-04, -5.29981735e-05, 2.31732865e-05, 4.47327948e-05], [ -2.09909238e-04, -1.37188399e-04, 4.32516608e-05, 1.22505269e-04, 1.57087343e-04], [ -1.33070716e-04, -2.86366521e-05, 1.40163713e-04, 2.32090286e-04, 2.44723196e-04], [ -1.59238552e-04, -2.70262608e-05, 1.26297164e-04, 2.43363946e-04, 2.34215157e-04]]], [[[ -8.66875416e-05, -1.36869785e-04, -1.62618715e-04, -1.32749497e-04, -9.78749595e-05], [ -4.88770056e-05, -1.04222396e-04, -5.68801443e-05, -5.32014456e-05, -2.01081693e-05], [ -1.06814099e-04, -7.92069040e-05, 7.38460722e-06, 1.02039130e-05, 9.61798214e-05], [ -1.77823778e-04, -2.69077882e-05, 1.01064907e-04, 1.01054131e-04, 9.41141989e-05], [ -1.93353102e-04, -8.10011989e-05, 9.71976988e-05, 9.82038255e-05, 2.37684708e-05]]], [[[ -4.30675527e-06, 1.17558056e-06, 3.43479478e-05, -5.51570192e-05, -3.77182369e-05], [ 2.07801513e-05, 3.08575691e-05, -6.87300926e-05, -1.05832238e-04, -6.79321965e-05], [ 1.34269372e-04, 6.84205588e-05, -5.34106111e-05, -1.64890880e-04, -1.01253063e-04], [ 1.36812290e-04, 8.36724867e-05, 1.49339839e-05, -4.27826853e-05, -5.93204368e-06], [ 1.39805590e-04, 9.71508489e-05, 3.47952409e-05, -8.16162265e-06, 1.40950360e-05]]], [[[ -8.09633057e-05, -6.38469646e-05, -5.52905185e-05, -4.93997868e-05, -2.70927603e-06], [ -7.76739980e-05, 2.14480951e-05, 3.34170400e-05, 6.38350684e-05, 2.91568122e-05], [ -6.50955335e-05, 1.62252909e-05, 6.13737939e-05, 9.51616457e-05, 2.29065718e-05], [ -8.85440968e-05, 1.59793490e-05, 9.34217460e-05, 7.06922074e-05, 6.61367740e-05], [ -1.89507246e-05, 5.67105635e-05, 7.39353709e-05, 1.07767497e-04, 1.91101106e-04]]], [[[ -1.23060701e-04, -1.21051322e-04, -5.45768598e-05, -8.50381275e-06, -5.77353312e-05], [ -7.07197760e-05, -1.78233659e-05, 3.35196200e-05, -9.95884147e-06, -2.30257083e-05], [ 8.51995446e-06, 6.38690690e-05, 8.33289378e-05, 4.99419984e-05, 7.31336622e-05], [ 6.05577261e-05, 6.05870409e-05, 6.96834613e-05, 6.61385056e-05, 1.15653209e-04], [ 7.78228641e-05, 1.00672325e-04, 1.30411136e-04, 1.84605975e-04, 1.85283367e-04]]], [[[ -1.49232830e-04, -5.74268124e-05, 4.24673499e-06, 7.07423942e-06, -1.46931707e-04], [ -1.43850455e-04, -1.50168751e-04, -7.53006098e-05, -9.34935160e-05, -2.13002320e-04], [ -1.50318418e-04, -1.43384954e-04, -9.33022602e-05, -9.79933757e-05, -1.96267982e-04], [ -1.27212465e-04, -1.12033398e-04, -2.57074389e-05, -3.41682353e-05, -1.17365758e-04], [ -9.60842226e-05, -6.75530537e-05, -8.59231204e-06, -7.20451055e-07, -5.27674129e-05]]], [[[ -6.10585848e-05, -3.25423644e-05, 4.05975807e-05, 1.37639407e-04, 2.27841912e-04], [ -5.46433221e-05, -3.47310452e-05, 5.44381364e-05, 1.09784472e-04, 1.73786597e-04], [ -6.76507480e-05, -1.59481842e-05, 3.94575909e-05, 7.60063122e-05, 1.12710462e-04], [ -3.06722359e-05, 2.85580190e-05, 6.94656483e-05, 8.80381322e-06, 5.68493488e-05], [ 4.58966460e-05, 7.84517688e-05, 1.00839854e-04, 1.56079459e-05, 2.49242748e-05]]], [[[ -1.08464570e-04, -9.95830706e-05, -5.02696348e-05, -1.02986187e-05, -6.33105665e-05], [ -3.88958733e-06, 2.86496634e-05, 1.82279491e-05, -5.71687742e-05, -1.23509933e-04], [ 1.36027840e-04, 1.14849441e-04, 1.18538519e-04, -1.04553073e-05, -3.63684157e-05], [ 1.73559645e-04, 8.98155849e-05, 7.93181098e-05, 4.19313401e-05, -2.75830880e-05], [ 1.57378148e-04, 1.23614991e-05, 6.92920003e-06, -5.90737136e-06, 6.94840992e-06]]], [[[ -6.51144001e-05, -7.46552687e-05, -7.05600905e-05, -2.82172623e-05, -5.79798725e-05], [ -7.29217281e-05, -1.24108803e-04, -8.56511615e-05, 8.84504516e-06, -9.81104768e-06], [ -1.08204913e-04, -1.47078594e-04, -2.48037759e-05, 1.44354844e-05, -1.90858082e-05], [ -9.59838289e-05, -7.28774467e-05, -4.31475964e-05, -2.25780241e-05, -2.83632016e-06], [ -6.75080155e-05, -5.71896453e-05, -5.86535680e-05, -4.08021406e-05, 2.73944374e-06]]], [[[ 3.67719222e-05, 1.23849823e-04, 1.62194541e-04, 8.38998603e-05, 1.36707706e-04], [ 1.30771892e-04, 1.91455081e-04, 2.16777145e-04, 1.89665676e-04, 2.39297209e-04], [ 1.32428788e-04, 1.68970219e-04, 2.11945153e-04, 3.13511584e-04, 3.62957275e-04], [ 3.89682245e-05, 7.27124861e-05, 1.69077437e-04, 3.67779809e-04, 3.94431991e-04], [ 1.61215248e-05, 3.86164611e-05, 1.33090667e-04, 2.35410014e-04, 2.62703805e-04]]], [[[ 1.91079554e-04, 1.33334819e-04, -2.40718018e-05, -1.14705297e-04, -2.26056014e-04], [ 2.78079067e-04, 1.80894334e-04, -5.96982136e-05, -1.88957594e-04, -2.87256204e-04], [ 2.38724489e-04, 8.59371285e-05, -8.94195255e-05, -2.50191428e-04, -2.83998554e-04], [ 1.41073455e-04, 4.13942234e-06, -9.39938254e-05, -1.74850691e-04, -1.68833634e-04], [ 2.99455824e-05, -3.69298177e-05, -1.03702580e-04, -1.00496363e-04, -1.06350897e-04]]]], dtype=float32) # print out my lenet image $ python python/draw_net.py examples/mnist/lenet_train_test.prototxt my_lenet.jpg

No comments: