In [23]:
%matplotlib inline

In [2]:
import matplotlib.pyplot as plt

In [3]:
import numpy
import numpy as np
import pandas
import pandas as pd

In [4]:
import os, sys
print(os.getcwd() )
print( os.listdir( "../data/") )


/home/topolo/PropD/cuBlackDream/examples
['ex2data2.txt', 'ex1data1.txt', 'ex1data2.txt', 'Xex1data2.npy', 'ex1data2.npy', 'ex2data1.txt']

In [5]:
ex1data1DF = pd.read_csv("../data/ex1data1.txt",header=None)
ex1data2DF = pd.read_csv("../data/ex1data2.txt", header=None)

In [6]:
Xyex1data1 = ex1data1DF.values
Xex1data1 = Xyex1data1[:,0]
yex1data1 = Xyex1data1[:,1]
Xyex1data2 = ex1data2DF.values
Xex1data2 = Xyex1data2[:,0:-1]
yex1data2 = Xyex1data2[:,-1]
print(Xex1data1.shape)
print(yex1data1.shape)
print(Xex1data2.shape)
print(yex1data2.shape)
Xex1data1 = np.vstack( Xex1data1 )
yex1data1 = np.vstack( yex1data1 )
yex1data2 = np.vstack( yex1data2 )
print(Xex1data1.shape)
print(yex1data1.shape)
print(Xex1data2.shape)
print(yex1data2.shape)


(97,)
(97,)
(47, 2)
(47,)
(97, 1)
(97, 1)
(47, 2)
(47, 1)

In [30]:
m_1 = Xex1data1.shape[0]
print(m_1)


97

In [7]:
Theta=np.array([0.])
b = np.array([0.])

In [8]:
a1 = np.matmul( Xex1data1, Theta) + b
print(a1)


[ 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.  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.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.
  0.  0.  0.  0.  0.  0.  0.]

In [9]:
res = np.vstack(a1) - yex1data1
print(np.hstack(res))


[-17.592    -9.1302  -13.662   -11.854    -6.8233  -11.886    -4.3483  -12.
  -6.5987   -3.8166   -3.2522  -15.505    -3.1551   -7.2258   -0.71618
  -3.5129   -5.3048   -0.56077  -3.6518   -5.3893   -3.1386  -21.767
  -4.263    -5.1875   -3.0825  -22.638   -13.501    -7.0467  -14.692
 -24.147     1.22     -5.9966  -12.134    -1.8495   -6.5426   -4.5623
  -4.1164   -3.3928  -10.117    -5.4974   -0.55657  -3.9115   -5.3854
  -2.4406   -6.7318   -1.0463   -5.1337   -1.844    -8.0043   -1.0179
  -6.7504   -1.8396   -4.2885   -4.9981   -1.4233    1.4211   -2.4756
  -4.6042   -3.9624   -5.4141   -5.1694    0.74279 -17.929   -12.054
 -17.054    -4.8852   -5.7442   -7.7754   -1.0173  -20.992    -6.6799
  -4.0259   -1.2784   -3.3411    2.6807   -0.29678  -3.8845   -5.7014
  -6.7526   -2.0576   -0.47953  -0.20421  -0.67861  -7.5435   -5.3436
  -4.2415   -6.7981   -0.92695  -0.152    -2.8214   -1.8451   -4.2959
  -7.2029   -1.9869   -0.14454  -9.0551   -0.61705]

In [10]:
np.matmul( np.hstack(res) , res)


Out[10]:
array([ 6222.11037223])

In [11]:
0.5 * np.matmul( np.hstack(res) , res) / (float( Xex1data1.size ) )


Out[11]:
array([ 32.07273388])

In [12]:
Xex1data1.size


Out[12]:
97

In [13]:
np.matmul( np.hstack(res) , Xex1data1) / (float( Xex1data1.size ))


Out[13]:
array([-65.32884975])

In [14]:
def feedfwd(X,Theta,b):
    a1 = np.matmul(X,Theta)
    a1b = a1 + b
    return a1,a1b

In [15]:
def costJ(X,Theta,b,y):
    m =X.shape[0]
    a1,a1b = feedfwd(X,Theta,b)
    res = (np.vstack(a1b) - y)
    J = 0.5 * np.matmul( np.hstack(res),res) /float(m)
    return res,J

In [16]:
a1_temp,a1b_temp = feedfwd(Xex1data1,Theta,b)

In [17]:
a1b_temp


Out[17]:
array([ 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.,  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.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
        0.,  0.,  0.,  0.,  0.,  0.])

In [18]:
feedfwd(Xex1data1,Theta,b)


Out[18]:
(array([ 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.,  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.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
         0.,  0.,  0.,  0.,  0.,  0.]),
 array([ 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.,  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.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
         0.,  0.,  0.,  0.,  0.,  0.]))

In [19]:
costJ(Xex1data1,Theta,b,yex1data1)


Out[19]:
(array([[-17.592  ],
        [ -9.1302 ],
        [-13.662  ],
        [-11.854  ],
        [ -6.8233 ],
        [-11.886  ],
        [ -4.3483 ],
        [-12.     ],
        [ -6.5987 ],
        [ -3.8166 ],
        [ -3.2522 ],
        [-15.505  ],
        [ -3.1551 ],
        [ -7.2258 ],
        [ -0.71618],
        [ -3.5129 ],
        [ -5.3048 ],
        [ -0.56077],
        [ -3.6518 ],
        [ -5.3893 ],
        [ -3.1386 ],
        [-21.767  ],
        [ -4.263  ],
        [ -5.1875 ],
        [ -3.0825 ],
        [-22.638  ],
        [-13.501  ],
        [ -7.0467 ],
        [-14.692  ],
        [-24.147  ],
        [  1.22   ],
        [ -5.9966 ],
        [-12.134  ],
        [ -1.8495 ],
        [ -6.5426 ],
        [ -4.5623 ],
        [ -4.1164 ],
        [ -3.3928 ],
        [-10.117  ],
        [ -5.4974 ],
        [ -0.55657],
        [ -3.9115 ],
        [ -5.3854 ],
        [ -2.4406 ],
        [ -6.7318 ],
        [ -1.0463 ],
        [ -5.1337 ],
        [ -1.844  ],
        [ -8.0043 ],
        [ -1.0179 ],
        [ -6.7504 ],
        [ -1.8396 ],
        [ -4.2885 ],
        [ -4.9981 ],
        [ -1.4233 ],
        [  1.4211 ],
        [ -2.4756 ],
        [ -4.6042 ],
        [ -3.9624 ],
        [ -5.4141 ],
        [ -5.1694 ],
        [  0.74279],
        [-17.929  ],
        [-12.054  ],
        [-17.054  ],
        [ -4.8852 ],
        [ -5.7442 ],
        [ -7.7754 ],
        [ -1.0173 ],
        [-20.992  ],
        [ -6.6799 ],
        [ -4.0259 ],
        [ -1.2784 ],
        [ -3.3411 ],
        [  2.6807 ],
        [ -0.29678],
        [ -3.8845 ],
        [ -5.7014 ],
        [ -6.7526 ],
        [ -2.0576 ],
        [ -0.47953],
        [ -0.20421],
        [ -0.67861],
        [ -7.5435 ],
        [ -5.3436 ],
        [ -4.2415 ],
        [ -6.7981 ],
        [ -0.92695],
        [ -0.152  ],
        [ -2.8214 ],
        [ -1.8451 ],
        [ -4.2959 ],
        [ -7.2029 ],
        [ -1.9869 ],
        [ -0.14454],
        [ -9.0551 ],
        [ -0.61705]]), array([ 32.07273388]))

In [25]:
def grad_desc_1( a0, yhat, y , Theta, b, alpha): 
    m = y.shape[0]
    
    res = np.vstack(yhat) - y 
    d_Theta = np.matmul( np.hstack(res), a0 ) 
    d_b = np.sum( res, axis=0)
    Thetatp1 = Theta - alpha * d_Theta/(float(m)) # gradient descent
    btp1 = b - alpha * d_b / (float(m)) # gradient descent
    return d_Theta,d_b , Thetatp1, btp1

In [26]:
# expect
#(array([-6336.89842532]),
# array([-566.3961]),
# array([ 0.6532885]),
# array([ 0.05839135]))

grad_desc_1( Xex1data1, a1b_temp , yex1data1, Theta,b,0.01)


Out[26]:
(array([-6336.89842532]),
 array([-566.3961]),
 array([ 0.6532885]),
 array([ 0.05839135]))

In [33]:
np.matmul( np.ones(1*m_1), res)


Out[33]:
array([-566.3961])

In [34]:
np.sum( res,axis=0)


Out[34]:
array([-566.3961])

In [22]:
res = np.vstack(a1b_temp) - yex1data1
print(res.shape)


(97, 1)

In [35]:
def gradDesc( X,y, Theta_0,b_0, alpha, iters):
    Theta=Theta_0
    b=b_0
    params_hist = []
    for iter in range(iters):
        a1,a1b = feedfwd(X,Theta,b) 
        res,J = costJ(X,Theta,b,y)
        d_Theta,d_b,Thetatp1,btp1 = grad_desc_1(X,np.vstack(a1b),y,Theta,b,alpha)
        Theta = Thetatp1
        b=btp1 # update
        params = list( [a1,a1b,res,J,d_Theta,d_b,Thetatp1,btp1 ])
        params_hist.append(params)
    return params_hist

In [36]:
import timeit

In [39]:
start_time = timeit.default_timer()
result1500 = gradDesc(Xex1data1,yex1data1, Theta,b,0.01,1500)
elapsedtime = timeit.default_timer() - start_time

In [40]:
print(elapsedtime ) # in seconds


1.15904808044

In [23]:
a1,a1b = feedfwd(Xex1data1, Theta,b)
res,J = costJ(Xex1data1,Theta,b,yex1data1)
d_Theta,d_b,Theta1p1, btp1 = grad_desc_1(Xex1data1,a1b,yex1data1,Theta,b,0.001)

In [24]:
result1500[-1][3:]


Out[24]:
[array([ 4.48341145]),
 array([-0.46719452]),
 array([ 4.65051348]),
 array([ 1.16636235]),
 array([-3.63029144])]

In [69]:
result10 = gradDesc(Xex1data1,yex1data1,Theta,b,0.001,10)

In [85]:
feedfwd(np.array([3.5,7]).reshape((2,1)),result1500[-1][-2],result1500[-1][-1])


Out[85]:
(array([ 4.14748496,  8.29496992]), array([ 0.22104595,  4.36853091]))

In [84]:
result1500[-2]


Out[84]:
[array([  6.54972916,  10.09362354,   8.29803775,   6.94323189,
          9.93283365,   8.85872878,  10.16412463,   7.68544843,
          5.98915661,   6.76656445,  16.78281452,   6.79417244,
          9.9630484 ,   6.68362199,   6.37400963,   7.54231344,
          6.07861598,   7.61838352,   8.37813647,   7.33341693,
         24.0177669 ,   6.50517721,   7.49574717,   6.59380715,
         22.4477846 ,  15.19979841,  12.98286492,  15.61214093,
         26.30816371,   6.22352831,   7.80772931,  10.95812096,
          6.98114845,   9.72926915,   9.40022456,   9.59276956,
          6.64286169,  15.20927755,   7.52809473,   6.40659417,
          8.15502125,  13.87271903,   6.84121267,   9.27142677,
          8.40455956,   6.00764093,   6.87403418,  13.8632399 ,
          6.56619916,   8.93432491,   6.28905285,   8.79652194,
          9.00885464,   7.50368595,   7.53461164,   7.43425126,
          6.6824371 ,  11.03158428,  11.20149784,  10.45714849,
          6.13691268,  25.21332322,  17.66437439,  22.46437309,
          8.55278959,   9.82880011,  12.12855757,   6.51619671,
         24.10189425,  12.01006834,   8.69059256,   7.11670012,
          8.56191326,   5.9563351 ,   7.75855628,   8.93242908,
          5.96771006,  12.17358348,   6.05207439,   6.78848496,
          6.1476952 ,   7.53081998,  11.5748574 ,   7.72063973,
         10.09196469,  10.87754828,   7.11172358,   6.54107945,
          5.9948441 ,   6.76300977,   9.04854853,   6.95614722,
          6.2863276 ,   9.82678579,  15.87044745,   6.44214094]),
 array([  2.62432256,   6.16821694,   4.37263115,   3.01782529,
          6.00742705,   4.93332218,   6.23871803,   3.76004183,
          2.06375001,   2.84115785,  12.85740792,   2.86876584,
          6.0376418 ,   2.75821539,   2.44860303,   3.61690684,
          2.15320938,   3.69297692,   4.45272987,   3.40801033,
         20.09236029,   2.57977061,   3.57034057,   2.66840055,
         18.522378  ,  11.27439181,   9.05745832,  11.68673433,
         22.38275711,   2.29812171,   3.88232271,   7.03271436,
          3.05574184,   5.80386255,   5.47481796,   5.66736296,
          2.71745509,  11.28387095,   3.60268813,   2.48118757,
          4.22961465,   9.94731243,   2.91580606,   5.34602017,
          4.47915296,   2.08223433,   2.94862758,   9.93783329,
          2.64079256,   5.00891831,   2.36364625,   4.87111534,
          5.08344804,   3.57827935,   3.60920504,   3.50884466,
          2.7570305 ,   7.10617768,   7.27609123,   6.53174189,
          2.21150608,  21.28791662,  13.73896779,  18.53896649,
          4.62738299,   5.90339351,   8.20315097,   2.59079011,
         20.17648765,   8.08466174,   4.76518596,   3.19129352,
          4.63650666,   2.0309285 ,   3.83314968,   5.00702248,
          2.04230346,   8.24817688,   2.12666779,   2.86307836,
          2.2222886 ,   3.60541338,   7.6494508 ,   3.79523313,
          6.16655809,   6.95214168,   3.18631698,   2.61567285,
          2.0694375 ,   2.83760317,   5.12314193,   3.03074062,
          2.360921  ,   5.90137919,  11.94504085,   2.51673434]),
 array([[-6.50587744],
        [-7.49378306],
        [-7.48136885],
        [-3.80547471],
        [-5.87857295],
        [ 0.58502218],
        [-5.76128197],
        [-2.83865817],
        [-1.75284999],
        [-0.41104215],
        [-2.64759208],
        [-0.28633416],
        [-1.1881582 ],
        [ 2.04203539],
        [-1.06429697],
        [-1.68789316],
        [ 1.59243938],
        [ 0.04117692],
        [-0.93657013],
        [ 0.26941033],
        [-1.67463971],
        [-1.68322939],
        [-1.61715943],
        [-0.41409945],
        [-4.115622  ],
        [-2.22660819],
        [ 2.01075832],
        [-3.00526567],
        [-1.76424289],
        [ 3.51812171],
        [-2.11427729],
        [-5.10128564],
        [ 1.20624184],
        [-0.73873745],
        [ 0.91251796],
        [ 1.55096296],
        [-0.67534491],
        [ 1.16687095],
        [-1.89471187],
        [ 1.92461757],
        [ 0.31811465],
        [ 4.56191243],
        [ 0.47520606],
        [-1.38577983],
        [ 3.43285296],
        [-3.05146567],
        [ 1.10462758],
        [ 1.93353329],
        [ 1.62289256],
        [-1.74148169],
        [ 0.52404625],
        [ 0.58261534],
        [ 0.08534804],
        [ 2.15497935],
        [ 5.03030504],
        [ 1.03324466],
        [-1.8471695 ],
        [ 3.14377768],
        [ 1.86199123],
        [ 1.36234189],
        [ 2.95429608],
        [ 3.35891662],
        [ 1.68496779],
        [ 1.48496649],
        [-0.25781701],
        [ 0.15919351],
        [ 0.42775097],
        [ 1.57349011],
        [-0.81551235],
        [ 1.40476174],
        [ 0.73928596],
        [ 1.91289352],
        [ 1.29540666],
        [ 4.7116285 ],
        [ 3.53636968],
        [ 1.12252248],
        [-3.65909654],
        [ 1.49557688],
        [ 0.06906779],
        [ 2.38354836],
        [ 2.0180786 ],
        [ 2.92680338],
        [ 0.1059508 ],
        [-1.54836687],
        [ 1.92505809],
        [ 0.15404168],
        [ 2.25936698],
        [ 2.46367285],
        [-0.7519625 ],
        [ 0.99250317],
        [ 0.82724193],
        [-4.17215938],
        [ 0.374021  ],
        [ 5.75683919],
        [ 2.88994085],
        [ 1.89968434]]),
 array([ 3.46704693]),
 array([-0.49678601]),
 array([ 4.96002126]),
 array([ 1.18494405]),
 array([-3.92592327])]

In [73]:
a1b.shape


Out[73]:
(96,)

In [91]:
plt.plot( np.array(result1500)[:,3])


Out[91]:
[<matplotlib.lines.Line2D at 0x7fdff2a01090>]

In [93]:
plt.plot( np.array(result1500)[2:,3])


Out[93]:
[<matplotlib.lines.Line2D at 0x7fdff0f91b50>]

Multi-dim. linear regression case

Feature Normalized, normalize features

cf. 4.3. Preprocessing data


In [1]:
# http://scikit-learn.org/stable/modules/preprocessing.html#normalization
import sklearn
from sklearn import preprocessing

In [31]:
Xex1data2 = preprocessing.normalize(ex1data2DF.values[:,:-1].astype(np.float32), axis=0, norm='l2' )

In [32]:
print( Xex1data2.dtype)
Xex1data2


float32
Out[32]:
array([[ 0.14276983,  0.13429844],
       [ 0.10857021,  0.13429844],
       [ 0.16285531,  0.13429844],
       [ 0.09608463,  0.08953229],
       [ 0.20356914,  0.17906459],
       [ 0.13469492,  0.17906459],
       [ 0.10409169,  0.13429844],
       [ 0.09683105,  0.13429844],
       [ 0.0936418 ,  0.13429844],
       [ 0.10137744,  0.13429844],
       [ 0.13164137,  0.17906459],
       [ 0.13571276,  0.13429844],
       [ 0.12824856,  0.13429844],
       [ 0.30386087,  0.22383073],
       [ 0.08604189,  0.13429844],
       [ 0.15606968,  0.17906459],
       [ 0.08957042,  0.08953229],
       [ 0.08387049,  0.13429844],
       [ 0.1770373 ,  0.17906459],
       [ 0.20567268,  0.17906459],
       [ 0.11990222,  0.13429844],
       [ 0.12811285,  0.08953229],
       [ 0.10884164,  0.13429844],
       [ 0.13313422,  0.17906459],
       [ 0.26396132,  0.13429844],
       [ 0.07464202,  0.13429844],
       [ 0.0989346 ,  0.13429844],
       [ 0.17140521,  0.13429844],
       [ 0.14928403,  0.13429844],
       [ 0.17893727,  0.13429844],
       [ 0.12478788,  0.08953229],
       [ 0.06785638,  0.04476615],
       [ 0.13842702,  0.17906459],
       [ 0.21286546,  0.13429844],
       [ 0.1228879 ,  0.17906459],
       [ 0.09750962,  0.13429844],
       [ 0.08407406,  0.13429844],
       [ 0.1446698 ,  0.17906459],
       [ 0.28601465,  0.17906459],
       [ 0.14670549,  0.17906459],
       [ 0.11291301,  0.08953229],
       [ 0.15186258,  0.13429844],
       [ 0.17418733,  0.17906459],
       [ 0.08142766,  0.13429844],
       [ 0.05781364,  0.08953229],
       [ 0.12567002,  0.17906459],
       [ 0.08163123,  0.13429844]], dtype=float32)

numpy.ndarray.tofile

ndarray.tofile(fid,sep="",format="%s")

Write array to a file as text or binary (default).

Data always written in 'C' order, independent of order of a.

Parameters

fid : file or str
An open file object, or string containing filename.
sep : str Separator between array items for text output. If "" (empty), a binary file is written, equivalent to file.write(a.tobytes())
format : str Format string for text file output. Each entry in the array is formatted to text by first converting it to closest Python type, and then using "format" % item.


In [33]:
Xex1data2.tofile("../data/" + "Xex1data2.npy")

Then go to CUDA C++14 file (e.g. cuBlackDreams/examples/linreg.cu in thise case). Load it with std::ifstream, Input stream class to operate on files. This function has been wrapped up in the function you'll find in cuBlackDreams/src/FileIO.h, cuBlackDreams/src/FileIO.cpp,

npy2fvec or std::vector npy2fvec( std::string &, const int m, const int n)

The most important thing to note is that NumPy reshapes (.reshape) into row-major ordering, i.e.

$$ \lbrace 0,1,\dots mn-1 \rbrace \to \lbrace 0,1, \dots m-1 \rbrace \times \lbrace 0,1, \dots n-1 \rbrace \\ k \mapsto (k/n, k \mod{n}) \\ $$

and so we'll read in this binary file, with std::ifstream and .read(...) in C++ in row-major ordering assumed for the matrix $A$. Or, I've wrapped up the procedure, serially (i.e. for loop), to convert to column-major ordering for a flattened matrix, in npy2fvec in cuBlackDreams/src/FileIO.h.

std::ifstream

typedef basic_ifstream<char> ifstream;

reinterpret_cast

reinterpret_cast < new_type > ( expression )

Returns a value of type new_type.


In [34]:
# sanity check
Xex1data2_in = np.fromfile("../data/"+ "Xex1data2.npy", dtype=np.float32)

In [35]:
Xex1data2_in


Out[35]:
array([ 0.14276983,  0.13429844,  0.10857021,  0.13429844,  0.16285531,
        0.13429844,  0.09608463,  0.08953229,  0.20356914,  0.17906459,
        0.13469492,  0.17906459,  0.10409169,  0.13429844,  0.09683105,
        0.13429844,  0.0936418 ,  0.13429844,  0.10137744,  0.13429844,
        0.13164137,  0.17906459,  0.13571276,  0.13429844,  0.12824856,
        0.13429844,  0.30386087,  0.22383073,  0.08604189,  0.13429844,
        0.15606968,  0.17906459,  0.08957042,  0.08953229,  0.08387049,
        0.13429844,  0.1770373 ,  0.17906459,  0.20567268,  0.17906459,
        0.11990222,  0.13429844,  0.12811285,  0.08953229,  0.10884164,
        0.13429844,  0.13313422,  0.17906459,  0.26396132,  0.13429844,
        0.07464202,  0.13429844,  0.0989346 ,  0.13429844,  0.17140521,
        0.13429844,  0.14928403,  0.13429844,  0.17893727,  0.13429844,
        0.12478788,  0.08953229,  0.06785638,  0.04476615,  0.13842702,
        0.17906459,  0.21286546,  0.13429844,  0.1228879 ,  0.17906459,
        0.09750962,  0.13429844,  0.08407406,  0.13429844,  0.1446698 ,
        0.17906459,  0.28601465,  0.17906459,  0.14670549,  0.17906459,
        0.11291301,  0.08953229,  0.15186258,  0.13429844,  0.17418733,
        0.17906459,  0.08142766,  0.13429844,  0.05781364,  0.08953229,
        0.12567002,  0.17906459,  0.08163123,  0.13429844], dtype=float32)

In [ ]: