In [4]:
import cntk as C
from cntk import load_model

In [5]:
import numpy as np
from PIL import Image as PILImage
from IPython.display import Image, display
import os
import requests
from io import BytesIO
from scipy import signal
from scipy import misc
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
%matplotlib inline

In [6]:
model_file_path = r'E:\local\cntk-models\AlexNet_ImageNet_CNTK.model'

alexnet_model = load_model(model_file_path)

In [7]:
parameters = alexnet_model.parameters
conv1_params = parameters[7]

In [31]:
#import matplotlib.image as mpimg
#source_image = mpimg.imread('https://farm1.staticflickr.com/345/31475692524_f89d59d742_b.jpg')
#imgplot = plt.imshow(source_image)

#response = requests.get('https://farm1.staticflickr.com/345/31475692524_f89d59d742_b.jpg')
#response = requests.get('https://68.media.tumblr.com/7885aeb5fa7969bc4f4afb9ed3409eb6/tumblr_olocn7WFC21vkeazao1_1280.jpg')
#source_url = 'https://68.media.tumblr.com/8d5e3fc3f93eaafadcf85c55fbe7ced5/tumblr_orw6xtlACK1vzmputo1_540.jpg'
source_url = 'https://68.media.tumblr.com/4ade8f00e286e7c26465af120cb1344e/tumblr_n9fyy5P0ds1rx8ak3o1_500.jpg'
response = requests.get(source_url)
source_image = PILImage.open(BytesIO(response.content))
print(source_image.mode)
#source_image2 = source_image.resize((int(source_image.width/2), int(source_image.height/2)))
#source_image2 = source_image.resize((224, 224))
source_image2 = source_image.copy()
source_image2.thumbnail((224,224))
print(source_image2.size)
source_image2.save('localimage.png')

Image('localimage.png')
mono_source_image2 = source_image2.convert(mode='L')
mono_source_image2.save('localimage-mono.png')
Image('localimage-mono.png')
display(Image('localimage.png'))

color_planes = source_image2.split()
mono_source_image2_0 = color_planes[0]
mono_source_image2_1 = color_planes[1]
mono_source_image2_2 = color_planes[2]


RGB
(152, 224)

In [9]:
array_of_source = np.array(source_image2)
print(array_of_source.shape)
print(array_of_source.dtype)
array_of_mono_source = np.array(mono_source_image2)
print(array_of_mono_source.shape)
print(array_of_mono_source.dtype)
conv_mask_from_layer1 = conv1_params.value[95][1]
print(conv_mask_from_layer1.shape)
print(conv_mask_from_layer1.dtype)
print(conv_mask_from_layer1)

array_of_mono_source_0 = np.array(mono_source_image2_0)
array_of_mono_source_1 = np.array(mono_source_image2_1)
array_of_mono_source_2 = np.array(mono_source_image2_2)


(224, 152, 3)
uint8
(224, 152)
uint8
(11, 11)
float32
[[-0.0196941   0.01812091 -0.01171606  0.03304913 -0.03505275 -0.01357912
   0.03713367 -0.0266745   0.0332072  -0.05432191  0.0293942 ]
 [ 0.0193992  -0.01193932 -0.00686511  0.00716311 -0.06987815  0.13772959
  -0.04716133 -0.11091615  0.1124331  -0.01456295 -0.01433235]
 [ 0.04779427 -0.09663673  0.03275482  0.0558542  -0.02579607  0.01014375
  -0.04753259  0.03975394  0.01984379 -0.01217694 -0.01736983]
 [-0.04822949  0.05950547  0.05617591 -0.19496857  0.286744   -0.28646001
  -0.03698459  0.41080534 -0.36049843  0.05298427  0.05077678]
 [-0.03711371  0.12415408 -0.11194868 -0.02120375  0.08553169 -0.06755364
   0.07975967 -0.077264   -0.06444327  0.13929135 -0.07310369]
 [ 0.07038689 -0.10976133 -0.02682837  0.23534721 -0.3033337   0.2004361
   0.10012508 -0.34890643  0.29523769 -0.09338871 -0.00655582]
 [ 0.00998513 -0.0701258   0.11208896 -0.04276375 -0.0874863   0.1338995
  -0.05582892 -0.02523827  0.06104892 -0.08319195  0.0627761 ]
 [-0.06107691  0.10962566 -0.0379662  -0.10604157  0.12604266 -0.00916961
  -0.06020782 -0.00853043  0.04642713  0.00298177 -0.01381177]
 [ 0.03118993 -0.01833645 -0.03146056  0.00767669  0.10054156 -0.14253832
  -0.00872877  0.16297933 -0.10381246 -0.02123646  0.02939769]
 [ 0.01850243 -0.0337218   0.01807118  0.01883288 -0.00847656 -0.04131053
   0.02940533  0.0683476  -0.11298946  0.06283154 -0.01875157]
 [-0.00807153  0.01179529 -0.00199887  0.01731831 -0.05434098  0.07021382
  -0.00191812 -0.07565961  0.06180849  0.01477173 -0.01884863]]

In [10]:
# make a filter mask for testing
testfilter = np.zeros((11,11),'float32')
testfilter[5][5] = 4.
testfilter[4][4] = -1
testfilter[6][4] = -1
testfilter[4][6] = -1
testfilter[6][6] = -1
testfilter[5][4] = 1
testfilter[4][5] = 1
testfilter[6][5] = 1
testfilter[5][6] = 1
testfilter[3][5] = -1
testfilter[3][7] = -1
testfilter[5][3] = -1
testfilter[7][3] = -1
testfilter_stack = np.dstack((testfilter,testfilter,testfilter))
print(testfilter)


[[ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]
 [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]
 [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]
 [ 0.  0.  0.  0.  0. -1.  0. -1.  0.  0.  0.]
 [ 0.  0.  0.  0. -1.  1. -1.  0.  0.  0.  0.]
 [ 0.  0.  0. -1.  1.  4.  1.  0.  0.  0.  0.]
 [ 0.  0.  0.  0. -1.  1. -1.  0.  0.  0.  0.]
 [ 0.  0.  0. -1.  0.  0.  0.  0.  0.  0.  0.]
 [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]
 [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]
 [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.]]

In [11]:
def make_filter_weight_image(filter_weights, image_file_name, dim=11):
    imstack = np.dstack((filter_weights[0], filter_weights[1], filter_weights[2]))
    # hacky range normalization so we can see something
    immean = imstack.mean()
    #print(immean)
    imstack -= immean
    imstack = imstack * (255.0/imstack.max())
    imstack += 127.
    #print (imstack[0])
    imstack = np.clip(imstack, 0., 255.)
    imint = (imstack * (255.0 / imstack.max())).astype('uint8')
    #imint = imstack.astype('uint8')
    #print(imint[0])
    try:
        os.remove(image_file_name)
    except OSError:
        pass

    im = PILImage.fromarray(imint)
    im2 = im.resize((224,224))
    im2.save(image_file_name)

In [12]:
make_filter_weight_image(testfilter, 'testfilter.png', dim=11)
Image('testfilter.png')


C:\Program Files\Anaconda3\envs\cntk35\lib\site-packages\ipykernel\__main__.py:7: RuntimeWarning: divide by zero encountered in true_divide
C:\Program Files\Anaconda3\envs\cntk35\lib\site-packages\ipykernel\__main__.py:7: RuntimeWarning: invalid value encountered in multiply
Out[12]:

In [13]:
print(array_of_mono_source.shape, testfilter.shape)
#filtered_image = signal.convolve2d(array_of_mono_source, testfilter, boundary='symm', mode = 'same')
filtered_image = signal.convolve2d(array_of_mono_source, conv_mask_from_layer1, boundary='symm', mode = 'same')


(224, 152) (11, 11)

In [15]:
im3 = PILImage.fromarray(filtered_image.astype('uint8'))
im3.save('filtered_out.png')
display(Image('filtered_out.png'))



In [34]:
#conv_mask_from_layer1 = conv1_params.value[95][1]
#filtered_image = signal.convolve2d(array_of_mono_source, conv_mask_from_layer1, boundary='symm', mode = 'same')
#im3 = PILImage.fromarray(filtered_image.astype('uint8'))
#im3.save('filtered_out.png')
#Image('filtered_out.png')
from IPython.display import clear_output, display
import time

for i in range(0,96):
    conv_mask0_from_layer1 = conv1_params.value[i][0]
    filtered_image0 = signal.convolve2d(array_of_mono_source_0, conv_mask0_from_layer1, boundary='symm', mode = 'same')
    conv_mask1_from_layer1 = conv1_params.value[i][1]
    filtered_image1 = signal.convolve2d(array_of_mono_source_1, conv_mask1_from_layer1, boundary='symm', mode = 'same')
    conv_mask2_from_layer1 = conv1_params.value[i][2]
    filtered_image2 = signal.convolve2d(array_of_mono_source_2, conv_mask2_from_layer1, boundary='symm', mode = 'same')
    
#    filtered_image = filtered_image0 + filtered_image1 + filtered_image2
#    filtered_image = np.clip(filtered_image, 0., 255.)
    
    filtered_image0 = np.clip(filtered_image0, 0., 255.)
    filtered_image1 = np.clip(filtered_image0, 0., 255.)
    filtered_image2 = np.clip(filtered_image0, 0., 255.)
    filtered_image = np.dstack((filtered_image0,filtered_image1,filtered_image2))
    
    make_filter_weight_image(conv1_params.value[i], 'testimage2.png', dim=11)
    filtermask_image = PILImage.open('testimage2.png')
    im3 = PILImage.fromarray(filtered_image.astype('uint8'))
    #im3 = im3.resize((im3.width*2, im3.height*2))
    im3.save('filtered_out.png')


    #display(Image('filtered_out.png'), Image('testimage2.png'))
    new_size = ((im3.width *2) + 224, im3.height)
    im_combine = PILImage.new('RGB', new_size)
    im_combine.paste(filtermask_image, (0,0))
    im_combine.paste(im3, (filtermask_image.width, 0))
    im_combine.paste(source_image2, (filtermask_image.width + im3.width, 0))
    im_combine.save('combined_out.png')
    clear_output()
    print ('conv1, filter ', i, im3.size)
    display(Image('combined_out.png'))
    time.sleep(1)


conv1, filter  95 (152, 224)

In [141]:
import os
make_filter_weight_image(testweights, 'testfilter.png', dim=11)
Image('testfilter.png')


Out[141]:

In [76]:
from PIL import Image as PILImage
inttw = twstack.astype('uint8')
print(inttw.dtype)

im = PILImage.fromarray(inttw)
im = im.resize((11*16,11*16))
im.save('testimage.png')
Image('testimage.png')


uint8
Out[76]:

In [81]:
#make_filter_weight_image(testweights, 'testimage2.png', dim=11)
from IPython.display import clear_output, display
import time

print(conv1_params.value[0].shape)
for i in range(0,95):
    make_filter_weight_image(conv1_params.value[i], 'testimage2.png', dim=11)
    clear_output()
    print ('conv1, filter ', i)
    display(Image('testimage2.png'))
    time.sleep(1)
#Image('testimage2.png')


conv1, filter  94

In [146]:
import json
def read_conv1_filter_values(filter_json_file_name):
    f = open (filter_json_file_name)
    filters = list()
    for line in f:
        filters.append(json.loads(line))

#    print(filters)
    return filters

In [147]:
conv1filters = read_conv1_filter_values('AlexNet_ImageNet_CNTK-conv1.json')
len(conv1filters)


Out[147]:
96

In [155]:
len(conv1filters[0]['weights'][0][0])


Out[155]:
11

In [132]:
conv1filters[0]


Out[132]:
{'bias': -0.035389818251132965,
 'i': 0,
 'layer': 'conv1',
 'weights': [[[0.0035063044633716345,
    -0.013895695097744465,
    -0.020732879638671875,
    -0.020718930289149284,
    -0.013473227620124817,
    -0.005862415302544832,
    0.003017171984538436,
    0.027882372960448265,
    0.03413316234946251,
    0.021074077114462852,
    0.026036283001303673],
   [0.018067121505737305,
    -0.00016060806228779256,
    -0.012837309390306473,
    -0.025828111916780472,
    -0.044070299714803696,
    -0.042192187160253525,
    -0.037241581827402115,
    -0.020669737830758095,
    0.021785667166113853,
    0.029764562845230103,
    0.02021818980574608],
   [0.02805887907743454,
    0.02295074425637722,
    0.02018769085407257,
    0.017911968752741814,
    0.002274484606459737,
    -0.03648888319730759,
    -0.06663355231285095,
    -0.08065685629844666,
    -0.06457412242889404,
    -0.013491620309650898,
    0.020037584006786346],
   [0.026322776451706886,
    0.021075431257486343,
    0.021519076079130173,
    0.029392343014478683,
    0.048994630575180054,
    0.042698562145233154,
    0.004321414511650801,
    -0.03813124820590019,
    -0.09169495850801468,
    -0.08083847910165787,
    -0.03784901648759842],
   [0.007294573355466127,
    0.023520464077591896,
    0.024315714836120605,
    0.008671515621244907,
    -0.0015551572432741523,
    0.03451216593384743,
    0.06878390163183212,
    0.07186311483383179,
    0.025647450238466263,
    -0.04660215601325035,
    -0.07053560018539429],
   [-0.020272070541977882,
    0.0030380666721612215,
    0.026234934106469154,
    0.03907810151576996,
    0.009893904440104961,
    -0.022746490314602852,
    -0.008841399103403091,
    0.03485153242945671,
    0.05774880573153496,
    0.033672995865345,
    -0.010160764679312706],
   [-0.031980615109205246,
    -0.03568116948008537,
    -0.012949756346642971,
    0.04091183468699455,
    0.08056449145078659,
    0.06258532404899597,
    0.012922543101012707,
    -0.021189050748944283,
    -0.007821417413651943,
    0.010188814252614975,
    0.018663683906197548],
   [-0.014450100250542164,
    -0.030490120872855186,
    -0.05296538025140762,
    -0.04145605489611626,
    0.0062605831772089005,
    0.05309588089585304,
    0.07230518013238907,
    0.0489179752767086,
    0.0214141346514225,
    0.011992862448096275,
    0.020924385637044907],
   [-0.007559482008218765,
    -0.007688368670642376,
    -0.025105178356170654,
    -0.05119934305548668,
    -0.06952346116304398,
    -0.04878411442041397,
    0.0008680507307872176,
    0.03630349412560463,
    0.04269172623753548,
    0.031264230608940125,
    0.033412061631679535],
   [-0.00024572754045948386,
    -0.0020003141835331917,
    0.0072082937695086,
    -0.006573077291250229,
    -0.0300610288977623,
    -0.04876938834786415,
    -0.045509982854127884,
    -0.0249798484146595,
    -0.006703353952616453,
    0.012705258093774319,
    0.025172559544444084],
   [0.01879093237221241,
    0.008665143512189388,
    0.011598566547036171,
    0.014125143177807331,
    0.006091567222028971,
    -0.005174701102077961,
    -0.013742184266448021,
    -0.026328442618250847,
    -0.028663968667387962,
    -0.015151315368711948,
    0.008225091733038425]],
  [[-0.0065169185400009155,
    0.0008354106685146689,
    0.003035692498087883,
    0.012241101823747158,
    0.00646493723616004,
    0.0019354366231709719,
    -0.0003815532836597413,
    0.007001379504799843,
    0.008911129087209702,
    -0.009727966040372849,
    -0.009370074607431889],
   [-0.006070311181247234,
    -0.0036281906068325043,
    0.005870256572961807,
    0.011203499510884285,
    0.0036154978442937136,
    0.005879731848835945,
    -0.0044079916551709175,
    -0.006823296658694744,
    0.021335165947675705,
    0.02076689526438713,
    0.0010592816397547722],
   [-0.01590186171233654,
    -0.008224264718592167,
    0.004839727189391851,
    0.027141883969306946,
    0.04805240035057068,
    0.03162028640508652,
    -0.0003624873352237046,
    -0.027351438999176025,
    -0.040219563990831375,
    -0.007356936577707529,
    0.021112019196152687],
   [-0.016047395765781403,
    -0.03432050347328186,
    -0.047926418483257294,
    -0.033989354968070984,
    0.024860579520463943,
    0.07502471655607224,
    0.08962169289588928,
    0.0628679096698761,
    -0.012392617762088776,
    -0.04283977672457695,
    -0.0164997149258852],
   [0.0016421941109001637,
    -0.007643520832061768,
    -0.04423821344971657,
    -0.1004067212343216,
    -0.12507399916648865,
    -0.05860306695103645,
    0.051237802952528,
    0.12652470171451569,
    0.12424898147583008,
    0.047870635986328125,
    -0.003416941035538912],
   [0.0124264657497406,
    0.031285375356674194,
    0.03312329202890396,
    -0.005110099911689758,
    -0.09451593458652496,
    -0.17651112377643585,
    -0.16467468440532684,
    -0.06086217984557152,
    0.046865325421094894,
    0.08243793249130249,
    0.057129207998514175],
   [0.014999679289758205,
    0.014867241494357586,
    0.04325670003890991,
    0.09147477149963379,
    0.091920405626297,
    0.003536099335178733,
    -0.1122012659907341,
    -0.16761541366577148,
    -0.12327823787927628,
    -0.04615260288119316,
    0.017219915986061096],
   [0.01974552869796753,
    0.004096965305507183,
    -0.006823251489549875,
    0.01245492696762085,
    0.06868072599172592,
    0.09828660637140274,
    0.06894576549530029,
    -0.005557096563279629,
    -0.07132532447576523,
    -0.07431037724018097,
    -0.043165408074855804],
   [0.010668712668120861,
    0.015052497386932373,
    0.0009736885549500585,
    -0.018769538030028343,
    -0.019906047731637955,
    0.013489262200891972,
    0.05177345499396324,
    0.06200268119573593,
    0.024033410474658012,
    -0.014400473795831203,
    -0.02888386882841587],
   [-0.00010863247007364407,
    0.007340557407587767,
    0.014345462433993816,
    0.009898187592625618,
    -0.0033039527479559183,
    -0.015775294974446297,
    -0.006737010087817907,
    0.014580454677343369,
    0.02190624549984932,
    0.009262063540518284,
    -0.011317931115627289],
   [0.00579719478264451,
    -0.002566654235124588,
    -0.00549237709492445,
    0.005000472068786621,
    0.006750405766069889,
    0.005949094891548157,
    0.0047326707281172276,
    0.0016630289610475302,
    0.004892588593065739,
    0.0031906592193990946,
    -0.005660560447722673]],
  [[0.001968243857845664,
    0.0233540628105402,
    0.030607132241129875,
    0.0361001156270504,
    0.021990500390529633,
    -0.0033441430423408747,
    -0.026815839111804962,
    -0.030975354835391045,
    -0.035523414611816406,
    -0.05175346881151199,
    -0.04954148828983307],
   [-0.023692522197961807,
    0.0032726183999329805,
    0.024022242054343224,
    0.03944675624370575,
    0.03723563998937607,
    0.03320867568254471,
    0.009207681752741337,
    -0.014469311572611332,
    -0.004679469391703606,
    -0.011546055786311626,
    -0.03089318238198757],
   [-0.04643028974533081,
    -0.0240870863199234,
    0.0014521011617034674,
    0.04825317859649658,
    0.08279113471508026,
    0.08241870254278183,
    0.04858621954917908,
    0.0029523728881031275,
    -0.02909849025309086,
    -0.012844116427004337,
    0.0038337057922035456],
   [-0.03940975293517113,
    -0.06105314940214157,
    -0.0746096521615982,
    -0.04915981739759445,
    0.03008454293012619,
    0.10283993184566498,
    0.13664120435714722,
    0.1146497055888176,
    0.029765073210000992,
    -0.01783154346048832,
    -0.004664302337914705],
   [-0.0027022992726415396,
    -0.024710452184081078,
    -0.07908983528614044,
    -0.14379268884658813,
    -0.16295620799064636,
    -0.0720253437757492,
    0.06369176506996155,
    0.1712951958179474,
    0.17183400690555573,
    0.0973547101020813,
    0.04303063824772835],
   [0.025555923581123352,
    0.029734710231423378,
    0.012575956992805004,
    -0.04692345857620239,
    -0.15372848510742188,
    -0.23508024215698242,
    -0.2020510733127594,
    -0.06786899268627167,
    0.07066917419433594,
    0.1268605887889862,
    0.12041997164487839],
   [0.03854213282465935,
    0.03325977176427841,
    0.05490938201546669,
    0.0895126461982727,
    0.06429068744182587,
    -0.042013946920633316,
    -0.16724655032157898,
    -0.21795670688152313,
    -0.14955182373523712,
    -0.0414426214993,
    0.053215477615594864],
   [0.0324370302259922,
    0.02031543105840683,
    0.01828141137957573,
    0.042946066707372665,
    0.08807231485843658,
    0.09729015827178955,
    0.04642844572663307,
    -0.053662024438381195,
    -0.11614990234375,
    -0.10306864976882935,
    -0.05189705640077591],
   [0.0043574548326432705,
    0.014592153951525688,
    0.016856834292411804,
    0.009214462712407112,
    0.013021111488342285,
    0.044575199484825134,
    0.07083553820848465,
    0.054777842015028,
    0.0017215937841683626,
    -0.03941097483038902,
    -0.05166975408792496],
   [-0.019459377974271774,
    -0.009135380387306213,
    0.006792123895138502,
    0.0128429951146245,
    0.008741211146116257,
    0.012188858352601528,
    0.023550694808363914,
    0.03165142238140106,
    0.02978353388607502,
    -0.0003523114719428122,
    -0.034135252237319946],
   [-0.024102455005049706,
    -0.033065274357795715,
    -0.031465839594602585,
    -0.012256844900548458,
    0.0006830158527009189,
    0.00651137437671423,
    0.018110767006874084,
    0.022496549412608147,
    0.033568013459444046,
    0.019919099286198616,
    -0.007884329184889793]]]}

In [133]:
conv1filters[0]['bias']


Out[133]:
-0.035389818251132965

In [143]:
conv1filters[0]['weights'][2][10][10]


Out[143]:
-0.007884329184889793

In [175]:
k0 = np.array(conv1filters[0]['weights'])
biaslist = list()
for filter in conv1filters:
    biaslist.append(filter['bias'])
bias = np.array(biaslist)
print(k0.shape, bias.shape)


(3, 11, 11) (96,)

In [176]:
bias[0]


Out[176]:
-0.035389818251132965

In [170]:
k0[0]


Out[170]:
array([[  1.73064768e-02,   8.73401295e-03,   1.60441995e-02,
          2.00646892e-02,   2.68514804e-03,   2.85548903e-02,
          4.08663265e-02,   2.69594248e-02,   3.00040692e-02,
          2.39196401e-02,   1.37169054e-02],
       [  1.59432422e-02,   7.28006521e-03,   1.77264232e-02,
          2.10685972e-02,  -4.14992403e-03,   2.39501800e-02,
          3.80039439e-02,   2.14874893e-02,   2.65124664e-02,
          2.44861506e-02,   1.76969636e-02],
       [  1.93274897e-02,   4.88809403e-03,   1.65833905e-02,
          2.45240070e-02,  -6.17939513e-03,   3.36532891e-02,
          3.06074545e-02,   1.43429581e-02,   2.60346290e-02,
          2.06848476e-02,   1.34924660e-02],
       [  1.75296273e-02,   3.79907270e-03,   2.03119963e-02,
          3.12960520e-02,  -1.08226286e-02,   3.06288898e-02,
          2.54144613e-02,   6.97628828e-03,   2.51357425e-02,
          2.04279292e-02,   1.60310194e-02],
       [  1.23166386e-02,   4.90326481e-03,   2.27268431e-02,
          2.96424832e-02,  -1.88962203e-02,   2.49982234e-02,
          2.94665005e-02,   1.05282823e-02,   2.68047713e-02,
          3.12371273e-02,   2.31308043e-02],
       [  1.35329934e-02,   2.21819454e-03,   1.40210306e-02,
          1.35506447e-02,  -2.35620514e-02,   3.87894474e-02,
          4.38504629e-02,   2.24343669e-02,   3.37256342e-02,
          2.46099699e-02,   2.21032612e-02],
       [  7.66032655e-03,  -5.08539379e-03,   1.13718472e-02,
          1.92038566e-02,   1.79956642e-05,   5.35334349e-02,
          4.64136340e-02,   1.94443092e-02,   1.75642297e-02,
          1.26121957e-02,   1.96328461e-02],
       [  1.26362452e-02,   1.27444817e-02,   4.13908139e-02,
          4.67621982e-02,   1.19229127e-02,   4.30626981e-02,
          2.13279966e-02,  -6.90110354e-03,   1.34497518e-02,
          2.54961550e-02,   3.30309831e-02],
       [  2.36992836e-02,   2.64446698e-02,   3.81043069e-02,
          3.11228260e-02,  -1.37437209e-02,   2.67508556e-03,
          2.78812856e-03,   8.42706300e-03,   4.43669185e-02,
          4.63567302e-02,   3.97491083e-02],
       [  2.06495412e-02,   8.49625375e-03,   1.11754686e-02,
          1.22910831e-03,  -2.74262391e-02,   6.82077277e-03,
          2.98021156e-02,   3.29187587e-02,   4.14345115e-02,
          3.62885967e-02,   2.83542555e-02],
       [  6.06105896e-03,  -5.31841023e-03,   2.14265333e-03,
          1.25957676e-03,  -7.29016121e-03,   2.10348908e-02,
          3.04588564e-02,   1.71607863e-02,   2.56198794e-02,
          2.91731488e-02,   2.47087069e-02]])

In [171]:
conv1_params.value[55][0]


Out[171]:
array([[  1.73064768e-02,   8.73401295e-03,   1.60441995e-02,
          2.00646892e-02,   2.68514804e-03,   2.85548903e-02,
          4.08663265e-02,   2.69594248e-02,   3.00040692e-02,
          2.39196401e-02,   1.37169054e-02],
       [  1.59432422e-02,   7.28006521e-03,   1.77264232e-02,
          2.10685972e-02,  -4.14992403e-03,   2.39501800e-02,
          3.80039439e-02,   2.14874893e-02,   2.65124664e-02,
          2.44861506e-02,   1.76969636e-02],
       [  1.93274897e-02,   4.88809403e-03,   1.65833905e-02,
          2.45240070e-02,  -6.17939513e-03,   3.36532891e-02,
          3.06074545e-02,   1.43429581e-02,   2.60346290e-02,
          2.06848476e-02,   1.34924660e-02],
       [  1.75296273e-02,   3.79907270e-03,   2.03119963e-02,
          3.12960520e-02,  -1.08226286e-02,   3.06288898e-02,
          2.54144613e-02,   6.97628828e-03,   2.51357425e-02,
          2.04279292e-02,   1.60310194e-02],
       [  1.23166386e-02,   4.90326481e-03,   2.27268431e-02,
          2.96424832e-02,  -1.88962203e-02,   2.49982234e-02,
          2.94665005e-02,   1.05282823e-02,   2.68047713e-02,
          3.12371273e-02,   2.31308043e-02],
       [  1.35329934e-02,   2.21819454e-03,   1.40210306e-02,
          1.35506447e-02,  -2.35620514e-02,   3.87894474e-02,
          4.38504629e-02,   2.24343669e-02,   3.37256342e-02,
          2.46099699e-02,   2.21032612e-02],
       [  7.66032655e-03,  -5.08539379e-03,   1.13718472e-02,
          1.92038566e-02,   1.79956642e-05,   5.35334349e-02,
          4.64136340e-02,   1.94443092e-02,   1.75642297e-02,
          1.26121957e-02,   1.96328461e-02],
       [  1.26362452e-02,   1.27444817e-02,   4.13908139e-02,
          4.67621982e-02,   1.19229127e-02,   4.30626981e-02,
          2.13279966e-02,  -6.90110354e-03,   1.34497518e-02,
          2.54961550e-02,   3.30309831e-02],
       [  2.36992836e-02,   2.64446698e-02,   3.81043069e-02,
          3.11228260e-02,  -1.37437209e-02,   2.67508556e-03,
          2.78812856e-03,   8.42706300e-03,   4.43669185e-02,
          4.63567302e-02,   3.97491083e-02],
       [  2.06495412e-02,   8.49625375e-03,   1.11754686e-02,
          1.22910831e-03,  -2.74262391e-02,   6.82077277e-03,
          2.98021156e-02,   3.29187587e-02,   4.14345115e-02,
          3.62885967e-02,   2.83542555e-02],
       [  6.06105896e-03,  -5.31841023e-03,   2.14265333e-03,
          1.25957676e-03,  -7.29016121e-03,   2.10348908e-02,
          3.04588564e-02,   1.71607863e-02,   2.56198794e-02,
          2.91731488e-02,   2.47087069e-02]], dtype=float32)

In [ ]: