In [1]:
import lasagne
import theano
import theano.tensor as T
import agentnet


WARNING (theano.configdefaults): Only clang++ is supported. With g++, we end up with strange g++/OSX bugs.
WARNING:theano.configdefaults:Only clang++ is supported. With g++, we end up with strange g++/OSX bugs.

In [2]:
import numpy as np
class ModRelu(lasagne.layers.Layer):
    def __init__(self, incoming, b=lasagne.init.Uniform(range=0.01), **kwargs):
        super(ModRelu, self).__init__(incoming, **kwargs)
        print(self.input_shape)
        self.n_hidden = self.input_shape[-1] // 2
        self.hb = self.add_param(b, (self.n_hidden,), name='hb', regularizable=False, trainable=True)

    def get_output_for(self, input, **kwargs):
        print("Inside a ModReLU")
        input_flattened = input.reshape((-1, input.shape[-1]))

        swap_re_im = np.concatenate((np.arange(self.n_hidden, 2*self.n_hidden), np.arange(self.n_hidden)))
        modulus = T.sqrt(input_flattened**2 + input_flattened[:, swap_re_im]**2+1e-5)
        rescale = T.maximum(modulus + T.tile(self.hb, [2]).dimshuffle('x', 0), 0.) / (modulus + 1e-5)
        out = (input_flattened * rescale).reshape(input.shape)
        return out

In [7]:
from lasagne.layers import *
inp =T.matrix("inp")
l_in = InputLayer([None,2],input_var=inp)
l_mrelu = ModRelu(l_in)

out = get_output(l_mrelu)
f = theano.function([inp], T.grad(out.mean(),inp))


[None, 2]
Inside a ModReLU
Out[7]:
<theano.compile.function_module.Function at 0x10878c668>

In [12]:



Out[12]:
'float64'

In [50]:
inp = input = T.matrix("inp")
n_hidden=1
epsilon=1e-5
hb = l_mrelu.hb #theano.shared(np.random.uniform(-0.01,0.01,size=(n_hidden,)).astype(theano.config.floatX))
#layer
input_flat = input
input = input.reshape((input.shape[0],2,n_hidden))

modulus_sqr= T.sum(input**2,1,keepdims=True) + epsilon
modulus = T.sqrt(modulus_sqr)
#modulus = T.switch(T.lt(modulus_sqr,epsilon),0,modulus)

rescale = T.maximum((modulus+hb[None,None,:])/(modulus+epsilon), 0.)

out = input *rescale
out = out.reshape(input_flat.shape)
#/layer

In [51]:
f = theano.function([inp], [T.grad(modulus.mean(),inp),modulus])

In [52]:
f(np.zeros([5,2]))


Out[52]:
[array([[ 0.,  0.],
        [ 0.,  0.],
        [ 0.,  0.],
        [ 0.,  0.],
        [ 0.,  0.]]), array([[[ 0.00316228]],
 
        [[ 0.00316228]],
 
        [[ 0.00316228]],
 
        [[ 0.00316228]],
 
        [[ 0.00316228]]])]

In [27]:
from layers import UnitaryLayer
from lasagne.layers import *
class step:
    n_inp = 2
    n_hid = 100

    l_in = InputLayer((None,n_inp))
    dense_input_layer = DenseLayer(l_in,n_hid*2,nonlinearity=None)

    l_prev_state = InputLayer((None,n_hid*2))
    unitary_step = UnitaryLayer(l_prev_state)

    added = ElemwiseSumLayer([dense_input_layer,unitary_step])

    new_state = ModRelu(added)
    
    out_layer = DenseLayer(new_state,1,nonlinearity=None)


(None, 200)

In [28]:
l_in = InputLayer([None,None,step.n_inp])

In [32]:
from agentnet.agent import Recurrence

rec = Recurrence(state_variables={step.new_state: step.l_prev_state},
                 input_sequences={step.l_in:l_in},
                 tracked_outputs=[step.out_layer],
                 unroll_scan=False)


/Users/cnst/anaconda/lib/python3.5/site-packages/agentnet/agent/recurrence.py:228: UserWarning: You are giving Recurrence an input sequence of undefined length (None).
Make sure it is always above <unspecified>(n_steps) you specified for recurrence
  "Make sure it is always above {}(n_steps) you specified for recurrence".format(n_steps or "<unspecified>"))

In [47]:
predictions_seq_layer = rec.get_sequence_layers()[1][0]
predicted_values = get_output(predictions_seq_layer)


Inside a ModReLU

In [40]:
predict = theano.function([l_in.input_var],predicted_values)


Inside a ModReLU

In [53]:
target_values = T.vector('target_output')
cost = T.mean((predicted_values - target_values)**2)
from utils.optimizations import custom_sgd

man = step.unitary_step.manifold
manifolds = {man.str_id : man}

params =get_all_params(predictions_seq_layer)

train = theano.function([l_in.input_var,target_values],cost,updates = custom_sgd(cost,params, 1e-4, manifolds))


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-53-df5d3827738f> in <module>()
      8 params =get_all_params(predictions_seq_layer)
      9 
---> 10 train = theano.function([l_in.input_var,target_values],cost,updates = custom_sgd(cost,params, 1e-4, manifolds))

/Users/cnst/anaconda/lib/python3.5/site-packages/theano/compile/function.py in function(inputs, outputs, mode, updates, givens, no_default_updates, accept_inplace, name, rebuild_strict, allow_input_downcast, profile, on_unused_input)
    324                    on_unused_input=on_unused_input,
    325                    profile=profile,
--> 326                    output_keys=output_keys)
    327     # We need to add the flag check_aliased inputs if we have any mutable or
    328     # borrowed used defined inputs

/Users/cnst/anaconda/lib/python3.5/site-packages/theano/compile/pfunc.py in pfunc(params, outputs, mode, updates, givens, no_default_updates, accept_inplace, name, rebuild_strict, allow_input_downcast, profile, on_unused_input, output_keys)
    482                          accept_inplace=accept_inplace, name=name,
    483                          profile=profile, on_unused_input=on_unused_input,
--> 484                          output_keys=output_keys)
    485 
    486 

/Users/cnst/anaconda/lib/python3.5/site-packages/theano/compile/function_module.py in orig_function(inputs, outputs, mode, accept_inplace, name, profile, on_unused_input, output_keys)
   1787                    on_unused_input=on_unused_input,
   1788                    output_keys=output_keys).create(
-> 1789             defaults)
   1790 
   1791     t2 = time.time()

/Users/cnst/anaconda/lib/python3.5/site-packages/theano/compile/function_module.py in create(self, input_storage, trustme, storage_map)
   1651             theano.config.traceback.limit = theano.config.traceback.compile_limit
   1652             _fn, _i, _o = self.linker.make_thunk(
-> 1653                 input_storage=input_storage_lists, storage_map=storage_map)
   1654         finally:
   1655             theano.config.traceback.limit = limit_orig

/Users/cnst/anaconda/lib/python3.5/site-packages/theano/gof/link.py in make_thunk(self, input_storage, output_storage, storage_map)
    697         return self.make_all(input_storage=input_storage,
    698                              output_storage=output_storage,
--> 699                              storage_map=storage_map)[:3]
    700 
    701     def make_all(self, input_storage, output_storage):

/Users/cnst/anaconda/lib/python3.5/site-packages/theano/gof/vm.py in make_all(self, profiler, input_storage, output_storage, storage_map)
   1049                                                  storage_map,
   1050                                                  compute_map,
-> 1051                                                  no_recycling))
   1052                 if not hasattr(thunks[-1], 'lazy'):
   1053                     # We don't want all ops maker to think about lazy Ops.

/Users/cnst/anaconda/lib/python3.5/site-packages/theano/scan_module/scan_op.py in make_thunk(self, node, storage_map, compute_map, no_recycling)
    855                                name=self.name,
    856                                profile=profile,
--> 857                                on_unused_input='ignore')
    858 
    859         # Analyse the compile inner function to determine which inputs and

/Users/cnst/anaconda/lib/python3.5/site-packages/theano/compile/function.py in function(inputs, outputs, mode, updates, givens, no_default_updates, accept_inplace, name, rebuild_strict, allow_input_downcast, profile, on_unused_input)
    324                    on_unused_input=on_unused_input,
    325                    profile=profile,
--> 326                    output_keys=output_keys)
    327     # We need to add the flag check_aliased inputs if we have any mutable or
    328     # borrowed used defined inputs

/Users/cnst/anaconda/lib/python3.5/site-packages/theano/compile/pfunc.py in pfunc(params, outputs, mode, updates, givens, no_default_updates, accept_inplace, name, rebuild_strict, allow_input_downcast, profile, on_unused_input, output_keys)
    482                          accept_inplace=accept_inplace, name=name,
    483                          profile=profile, on_unused_input=on_unused_input,
--> 484                          output_keys=output_keys)
    485 
    486 

/Users/cnst/anaconda/lib/python3.5/site-packages/theano/compile/function_module.py in orig_function(inputs, outputs, mode, accept_inplace, name, profile, on_unused_input, output_keys)
   1787                    on_unused_input=on_unused_input,
   1788                    output_keys=output_keys).create(
-> 1789             defaults)
   1790 
   1791     t2 = time.time()

/Users/cnst/anaconda/lib/python3.5/site-packages/theano/compile/function_module.py in create(self, input_storage, trustme, storage_map)
   1667         fn = self.function_builder(_fn, _i, _o, self.indices, self.outputs,
   1668                                    defaults, self.unpack_single,
-> 1669                                    self.return_none, self.output_keys, self)
   1670         fn.profile = self.profile
   1671         return fn

/Users/cnst/anaconda/lib/python3.5/site-packages/theano/compile/function_module.py in __init__(self, fn, input_storage, output_storage, indices, outputs, defaults, unpack_single, return_none, output_keys, maker)
    413                         assert not refeed
    414                     else:
--> 415                         c.value = value
    416                 c.required = required
    417                 c.implicit = input.implicit

/Users/cnst/anaconda/lib/python3.5/site-packages/theano/gof/link.py in __set__(self, value)
    477                                                            **kwargs)
    478             else:
--> 479                 self.storage[0] = self.type.filter(value, **kwargs)
    480 
    481         except Exception as e:

/Users/cnst/anaconda/lib/python3.5/site-packages/theano/tensor/type.py in filter(self, data, strict, allow_downcast)
    193             if b and data.shape[i] != 1:
    194                 raise TypeError("Non-unit value on shape on a broadcastable"
--> 195                                 " dimension.", data.shape, self.broadcastable)
    196             i += 1
    197         if (self.filter_checks_isfinite and

TypeError: ('The following error happened while compiling the node', forall_inplace,cpu,grad_of_scan_fn}(Shape_i{1}.0, Alloc.0, Subtensor{int64:int64:int64}.0, Subtensor{int64:int64:int64}.0, Alloc.0, Subtensor{::int64}.0, Alloc.0, Alloc.0, Alloc.0, Alloc.0, Shape_i{1}.0, Shape_i{1}.0, W, Subtensor{int64}.0, Subtensor{int64}.0, InplaceDimShuffle{x,0}.0, InplaceDimShuffle{1,0}.0, InplaceDimShuffle{1,0}.0, InplaceDimShuffle{1,0}.0, Alloc.0, MakeVector{dtype='int64'}.0, InplaceDimShuffle{x,0}.0), '\n', 'Non-unit value on shape on a broadcastable dimension.', (0, 0), (False, True), 'Container name "None"')

In [ ]:


In [43]:
def gen_data(min_length=50, max_length=51, n_batch=10):
    '''
    Generate a batch of sequences for the "add" task, e.g. the target for the
    following

    ``| 0.5 | 0.7 | 0.3 | 0.1 | 0.2 | ... | 0.5 | 0.9 | ... | 0.8 | 0.2 |
      |  0  |  0  |  1  |  0  |  0  |     |  0  |  1  |     |  0  |  0  |``

    would be 0.3 + .9 = 1.2.  This task was proposed in [1]_ and explored in
    e.g. [2]_.

    Parameters
    ----------
    min_length : int
        Minimum sequence length.
    max_length : int
        Maximum sequence length.
    n_batch : int
        Number of samples in the batch.

    Returns
    -------
    X : np.ndarray
        Input to the network, of shape (n_batch, max_length, 2), where the last
        dimension corresponds to the two sequences shown above.
    y : np.ndarray
        Correct output for each sample, shape (n_batch,).
    mask : np.ndarray
        A binary matrix of shape (n_batch, max_length) where ``mask[i, j] = 1``
        when ``j <= (length of sequence i)`` and ``mask[i, j] = 0`` when ``j >
        (length of sequence i)``.

    References
    ----------
    .. [1] Hochreiter, Sepp, and Jürgen Schmidhuber. "Long short-term memory."
    Neural computation 9.8 (1997): 1735-1780.

    .. [2] Sutskever, Ilya, et al. "On the importance of initialization and
    momentum in deep learning." Proceedings of the 30th international
    conference on machine learning (ICML-13). 2013.
    '''
    # Generate X - we'll fill the last dimension later
    X = np.concatenate([np.random.uniform(size=(n_batch, max_length, 1)),
                        np.zeros((n_batch, max_length, 1))],
                       axis=-1)
    mask = np.zeros((n_batch, max_length))
    y = np.zeros((n_batch,))
    # Compute masks and correct values
    for n in range(n_batch):
        # Randomly choose the sequence length
        length = np.random.randint(min_length, max_length)
        # Make the mask for this sample 1 within the range of length
        mask[n, :length] = 1
        # Zero out X after the end of the sequence
        X[n, length:, 0] = 0
        # Set the second dimension to 1 at the indices to add
        X[n, np.random.randint(length/10), 1] = 1
        X[n, np.random.randint(length/2, length), 1] = 1
        # Multiply and sum the dimensions of X to get the target value
        y[n] = np.sum(X[n, :, 0]*X[n, :, 1])
    # Center the inputs and outputs
    X -= X.reshape(-1, 2).mean(axis=0)
    y -= y.mean()
    return (X.astype(theano.config.floatX), y.astype(theano.config.floatX),
            mask.astype('int8'))

In [44]:
predict(gen_data()[0])


Out[44]:
array([[[ -6.92199105e-03],
        [ -1.97507428e-02],
        [  1.74082346e-02],
        [  7.42347221e-03],
        [ -2.19017882e-01],
        [ -8.67836482e-04],
        [  8.81435102e-02],
        [  4.23115938e-01],
        [ -1.13449303e-01],
        [ -4.42030841e-01],
        [ -5.60414894e-01],
        [  1.62660729e-01],
        [ -1.20688536e-01],
        [  7.44984617e-01],
        [ -2.70578416e-01],
        [ -1.17051409e+00],
        [  1.11047347e+00],
        [  3.60285927e-01],
        [  7.19354561e-01],
        [ -6.32025527e-01],
        [ -1.54389300e+00],
        [  1.84505313e-01],
        [  2.16735671e+00],
        [  1.39620174e-01],
        [  3.34565856e-01],
        [ -1.33875794e+00],
        [ -1.72908872e+00],
        [  2.82335794e+00],
        [ -5.68532052e-01],
        [ -7.71857395e-01],
        [  2.69739180e+00],
        [ -4.46903684e+00],
        [  4.17401297e+00],
        [  1.09102467e+00],
        [ -6.83753321e+00],
        [  9.88746940e+00],
        [ -1.00473073e+01],
        [ -5.12357450e-01],
        [  1.51987730e+01],
        [ -1.32802694e+01],
        [  9.86944799e+00],
        [ -9.24800165e+00],
        [ -1.46700164e+01],
        [  3.07921932e+01],
        [ -7.90068641e+00],
        [ -1.40215164e+01],
        [  1.17164722e+01],
        [ -2.86082920e+01],
        [  3.09109668e+01],
        [  2.64379964e+01],
        [ -7.27259453e+01]],

       [[  2.23540160e-02],
        [  3.67801812e-02],
        [ -1.01644061e-01],
        [ -1.10192890e-01],
        [  2.90083368e-01],
        [  1.22570880e-01],
        [  3.49327682e-01],
        [ -4.26443991e-01],
        [ -5.39341463e-02],
        [ -1.12855184e-01],
        [  6.54803386e-01],
        [ -7.75011172e-01],
        [  2.47379435e-01],
        [  1.68212889e-01],
        [ -6.14083256e-02],
        [  8.33438299e-01],
        [ -5.59538130e-01],
        [  1.76908159e-01],
        [ -2.39463626e-01],
        [ -2.52032033e-01],
        [ -3.22534861e-01],
        [  4.54065943e-01],
        [  3.75217826e-01],
        [  3.71637073e-01],
        [ -9.60179987e-01],
        [ -2.04718865e+00],
        [  2.74801877e+00],
        [ -5.83373072e-01],
        [ -1.75166032e-01],
        [  3.98450285e-01],
        [ -2.97514628e+00],
        [  5.52876937e+00],
        [ -6.29288386e-02],
        [ -8.13837219e+00],
        [  8.49749547e+00],
        [ -2.90941137e+00],
        [  3.78967519e-01],
        [  7.56839026e+00],
        [ -1.55323609e+01],
        [  1.30220664e+01],
        [ -3.27817189e-02],
        [ -8.73297308e+00],
        [  1.01902774e+01],
        [ -1.08309512e+01],
        [  6.36471697e+00],
        [  7.66193350e+00],
        [ -2.02590699e+01],
        [  8.71927932e+00],
        [  1.95782444e+01],
        [ -3.77327492e+01],
        [  3.25250151e+01]],

       [[  9.04808129e-03],
        [  1.64424650e-02],
        [ -1.16462938e-01],
        [ -8.85478123e-02],
        [  3.57753320e-01],
        [  3.48684461e-01],
        [ -3.85617146e-01],
        [ -3.74797948e-01],
        [ -2.81243997e-01],
        [  1.23488994e-01],
        [ -1.65538968e-02],
        [  5.19810000e-01],
        [ -7.49992687e-01],
        [ -5.69572265e-01],
        [  1.43805659e+00],
        [  1.64198796e-01],
        [  2.46152181e-01],
        [ -1.04836123e+00],
        [ -2.44554469e-01],
        [  2.05401510e-01],
        [  1.72499352e+00],
        [  3.32045828e-01],
        [ -1.44044241e+00],
        [ -6.76436296e-02],
        [ -9.37647921e-01],
        [  1.56366183e+00],
        [ -1.78264822e-02],
        [ -3.69384290e-01],
        [ -2.51606327e-02],
        [ -7.16911245e-01],
        [  7.93124222e-01],
        [  8.92051317e-01],
        [ -3.49315453e+00],
        [  3.27588385e+00],
        [ -3.68539923e+00],
        [  1.63015944e+00],
        [  8.52130020e+00],
        [ -9.11934346e+00],
        [  5.59939907e+00],
        [ -9.51472462e+00],
        [  2.91371400e+00],
        [  1.37075286e+01],
        [ -6.85558670e+00],
        [ -7.10175317e+00],
        [ -2.11984435e+00],
        [  1.66809840e+00],
        [  1.37918222e+01],
        [  1.11375908e+00],
        [ -3.13489937e+01],
        [  1.26634619e+01],
        [  1.21088117e+01]],

       [[ -3.60699320e-03],
        [ -3.80779616e-03],
        [ -7.72610275e-02],
        [ -5.10983615e-02],
        [  2.15220501e-01],
        [  3.66929648e-01],
        [ -3.77178621e-01],
        [ -2.82115114e-01],
        [ -1.09966970e-01],
        [ -9.88387411e-02],
        [  8.90865906e-02],
        [  4.66618948e-01],
        [ -5.69883900e-01],
        [ -5.61935307e-01],
        [  9.72770390e-01],
        [  1.25883232e-01],
        [  5.80532386e-01],
        [ -1.16532734e+00],
        [ -9.22615859e-01],
        [  2.88696950e-01],
        [  1.49759155e+00],
        [  9.84244940e-01],
        [ -1.40413984e+00],
        [ -6.05881375e-01],
        [ -3.45166304e-01],
        [  1.79380758e+00],
        [  7.31847774e-01],
        [ -1.13008329e+00],
        [ -6.07365075e-01],
        [  1.18488100e-01],
        [  1.86960256e+00],
        [ -9.27789745e-01],
        [ -1.69049124e+00],
        [  4.72583232e+00],
        [ -5.24233950e+00],
        [  3.46884913e+00],
        [  2.07570860e+00],
        [ -6.64432716e+00],
        [  1.02550360e+01],
        [ -1.41497640e+01],
        [  4.63646638e+00],
        [  1.20022361e+01],
        [ -9.73584668e+00],
        [  5.60104012e+00],
        [ -1.45050649e+01],
        [ -2.44829547e+00],
        [  2.62112910e+01],
        [ -9.53560460e+00],
        [ -1.46370323e+01],
        [  2.49283000e+00],
        [ -5.00833694e+00]],

       [[ -1.18982563e-02],
        [ -3.82904709e-02],
        [ -4.75828055e-02],
        [  5.36219078e-02],
        [  1.26147818e-01],
        [  2.05380518e-01],
        [ -3.37394177e-01],
        [ -6.86215501e-03],
        [  1.54302725e-01],
        [ -6.95759523e-04],
        [ -9.84110850e-02],
        [ -1.53472937e-01],
        [  6.07164716e-01],
        [ -1.30387670e-01],
        [  1.06194397e+00],
        [ -8.29129212e-01],
        [  7.59437336e-01],
        [ -8.97660718e-01],
        [  5.91907215e-01],
        [ -2.27466012e-01],
        [  3.97138164e-01],
        [ -1.65245985e-01],
        [ -1.40976095e-01],
        [  1.11352225e+00],
        [ -1.94455388e+00],
        [  1.62697153e+00],
        [ -6.00801828e-01],
        [ -2.14480259e+00],
        [  1.26929674e+00],
        [  2.54399493e-01],
        [  1.13370833e+00],
        [  1.25443429e-01],
        [ -3.05036673e+00],
        [  4.38768037e+00],
        [ -1.86303843e+00],
        [ -1.07634606e+00],
        [  2.39747346e+00],
        [ -7.96187556e+00],
        [  1.16893374e+01],
        [ -5.88138622e+00],
        [  1.20525816e+00],
        [  3.78357736e-01],
        [ -6.88521992e+00],
        [  7.13533863e+00],
        [ -4.98053860e+00],
        [  1.99168405e+00],
        [  1.28839727e+00],
        [  4.51236351e+00],
        [ -7.37686065e+00],
        [  8.04986886e-01],
        [  1.37425877e+01]],

       [[  1.24663665e-02],
        [  1.29745703e-02],
        [ -6.40373495e-02],
        [ -1.10419301e-01],
        [  1.77493074e-01],
        [  1.62230953e-01],
        [  2.15374772e-01],
        [ -1.10794218e-01],
        [ -6.09883289e-01],
        [  2.50684032e-01],
        [  2.63817245e-01],
        [ -2.27137658e-01],
        [  3.88790127e-02],
        [  4.42273037e-01],
        [ -7.82758578e-01],
        [  1.36605146e+00],
        [ -4.39328011e-01],
        [  5.35145087e-01],
        [ -1.12264183e+00],
        [ -3.63841507e-01],
        [  7.15456346e-01],
        [ -6.02471812e-01],
        [  6.21167980e-01],
        [  3.09007071e-01],
        [ -1.82961397e+00],
        [ -1.11892445e+00],
        [  3.05778228e+00],
        [ -2.10224578e+00],
        [  6.44586467e-01],
        [  1.46044969e+00],
        [ -4.43095956e+00],
        [  5.19667015e+00],
        [ -1.32631021e+00],
        [ -5.64186530e+00],
        [  9.29878843e+00],
        [ -5.93487203e+00],
        [  2.29506343e+00],
        [  7.74443265e+00],
        [ -1.72161381e+01],
        [  1.54988091e+01],
        [ -6.50303777e+00],
        [ -7.22891000e+00],
        [  2.21319400e+01],
        [ -2.35945298e+01],
        [  1.05109351e+01],
        [  9.34590604e+00],
        [ -3.55895152e+01],
        [  4.07688535e+01],
        [ -7.14206078e+00],
        [ -3.86358925e+01],
        [  6.22607242e+01]],

       [[  2.05637254e-02],
        [  5.60528152e-02],
        [ -5.36210124e-02],
        [ -1.79325843e-01],
        [  2.18662965e-01],
        [  3.20764493e-01],
        [  3.93721992e-01],
        [ -1.36044004e-01],
        [ -7.83765839e-01],
        [  4.41926552e-01],
        [  2.91030454e-01],
        [ -1.91350529e-02],
        [  3.42495600e-01],
        [ -6.47935202e-01],
        [ -3.40832018e-01],
        [  1.95259014e+00],
        [ -4.33738005e-01],
        [ -1.87339425e-01],
        [ -9.43592597e-01],
        [ -9.90370869e-01],
        [  1.50450206e+00],
        [ -1.52035393e-01],
        [  1.65249684e-01],
        [ -9.89589803e-01],
        [ -1.67223094e+00],
        [  2.75636541e-01],
        [  1.52373614e+00],
        [ -1.19440419e+00],
        [  8.99917211e-01],
        [  4.64472666e-01],
        [ -3.68696064e+00],
        [  8.06934410e+00],
        [ -3.82226364e+00],
        [ -4.73028092e+00],
        [  9.57922212e+00],
        [ -1.01102275e+01],
        [  8.66671646e+00],
        [  9.30009556e+00],
        [ -2.30758950e+01],
        [  1.90784617e+01],
        [ -1.10676352e+01],
        [ -5.69033244e+00],
        [  3.33978242e+01],
        [ -3.85785154e+01],
        [  1.16743864e+01],
        [  1.45935475e+01],
        [ -3.84017347e+01],
        [  5.81926214e+01],
        [ -3.08875918e+01],
        [ -4.05104029e+01],
        [  7.85070753e+01]],

       [[ -9.17745212e-02],
        [  7.60552733e-03],
        [  4.03129621e-01],
        [  1.82764510e-01],
        [ -3.73825956e-01],
        [ -2.18296428e-02],
        [ -1.31291262e-01],
        [  4.87348282e-01],
        [ -1.09318427e-01],
        [  1.74469134e-01],
        [ -1.31484590e-01],
        [ -1.33172539e-01],
        [  1.32941570e+00],
        [ -3.17871540e-01],
        [ -1.41024471e-01],
        [ -7.91015978e-01],
        [ -9.98086539e-02],
        [ -4.91653257e-01],
        [  1.73420791e+00],
        [ -1.07535743e+00],
        [ -3.66671070e-01],
        [  2.62384450e-01],
        [ -1.90231535e+00],
        [  2.00355554e+00],
        [  1.03525476e+00],
        [ -2.76623675e+00],
        [  1.16306974e+00],
        [ -9.00424146e-01],
        [  8.86278559e-01],
        [  4.38328131e+00],
        [ -6.64116674e+00],
        [  4.08202901e+00],
        [ -1.09382023e+00],
        [ -1.86648412e+00],
        [  7.79379435e+00],
        [ -9.79044605e+00],
        [  2.06898638e+00],
        [  4.45469144e+00],
        [ -3.67045150e+00],
        [  4.47603203e+00],
        [  2.17372899e+00],
        [ -1.63818407e+01],
        [  1.30696148e+01],
        [  5.21381143e-01],
        [ -1.07061119e+01],
        [  3.25191251e+01],
        [ -3.70986803e+01],
        [  2.49072605e+00],
        [  4.34069064e+01],
        [ -6.11304204e+01],
        [  6.41618843e+01]],

       [[  6.47309872e-03],
        [ -1.30372143e-02],
        [ -4.08604311e-02],
        [ -9.04499603e-02],
        [ -5.55066332e-02],
        [  1.81049796e-01],
        [  3.66412786e-01],
        [ -5.16433962e-01],
        [ -2.85185687e-01],
        [ -4.52997069e-01],
        [  1.94152814e-01],
        [  1.78208424e-01],
        [  1.08262417e-01],
        [ -5.26493890e-01],
        [ -7.34565554e-01],
        [  1.35370651e+00],
        [  7.78425202e-01],
        [  4.51803100e-01],
        [ -1.92921128e+00],
        [ -1.27669671e-01],
        [  5.43063266e-01],
        [  2.71897139e+00],
        [ -4.33896243e-01],
        [ -1.87284751e+00],
        [  1.93330838e-01],
        [ -2.45486154e-01],
        [  2.30843638e+00],
        [ -2.89091774e-01],
        [ -2.33566858e+00],
        [  1.58854334e+00],
        [  5.93572803e-03],
        [ -1.91580548e+00],
        [  1.31503117e+00],
        [ -2.13384012e+00],
        [  4.64034673e+00],
        [ -2.81039288e+00],
        [ -2.10722145e+00],
        [  5.51990090e+00],
        [ -2.69770608e+00],
        [  1.73824995e+00],
        [ -1.00904387e+01],
        [  6.65327373e+00],
        [  8.33898786e+00],
        [  1.66530044e+00],
        [ -1.49263027e+01],
        [ -1.30163101e+01],
        [  2.06020559e+01],
        [  4.44616422e+00],
        [  3.38572602e+00],
        [ -2.46602216e+01],
        [ -1.22525735e+01]],

       [[ -1.35464257e-02],
        [ -2.45099526e-02],
        [  7.32936136e-02],
        [ -4.25782289e-02],
        [ -3.20590264e-01],
        [  2.78691922e-01],
        [ -9.19057686e-02],
        [  5.21791794e-01],
        [ -5.20760819e-02],
        [ -5.73129160e-01],
        [ -3.77000744e-01],
        [  5.54899157e-01],
        [ -2.12855425e-01],
        [  6.89308828e-01],
        [  4.89561809e-02],
        [ -1.15378947e+00],
        [  1.54610057e+00],
        [ -5.13960285e-01],
        [  1.78993960e+00],
        [ -1.64700401e+00],
        [ -1.26011262e+00],
        [  4.71882444e-01],
        [  6.44110128e-01],
        [  7.49251955e-01],
        [  7.92203169e-01],
        [ -2.62702042e+00],
        [ -2.50673654e+00],
        [  4.17485556e+00],
        [ -2.91763117e+00],
        [  2.53771896e+00],
        [ -3.51527712e-02],
        [ -5.62298594e+00],
        [  6.64805261e+00],
        [ -5.70332897e-01],
        [ -6.40527486e+00],
        [  1.17650519e+01],
        [ -1.17231412e+01],
        [  2.04701792e+00],
        [  1.72204732e+01],
        [ -2.28873911e+01],
        [  2.07072538e+01],
        [ -1.52232606e+01],
        [ -1.21609422e+01],
        [  3.87947432e+01],
        [ -2.88701838e+01],
        [  7.58335331e+00],
        [  1.07049908e+01],
        [ -4.93480589e+01],
        [  5.99324747e+01],
        [  3.20960254e+00],
        [ -7.60128570e+01]]])

In [ ]: