In [1]:
import numpy as np
from keras.models import Model
from keras.layers import Input
from keras.layers.pooling import MaxPooling1D
from keras import backend as K
import json
from collections import OrderedDict


Using TensorFlow backend.

In [2]:
def format_decimal(arr, places=6):
    return [round(x * 10**places) / 10**places for x in arr]

In [3]:
DATA = OrderedDict()

MaxPooling1D

[pooling.MaxPooling1D.0] input 6x6, pool_size=2, strides=None, padding='valid'


In [4]:
data_in_shape = (6, 6)
L = MaxPooling1D(pool_size=2, strides=None, padding='valid')

layer_0 = Input(shape=data_in_shape)
layer_1 = L(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)

# set weights to random (use seed for reproducibility)
np.random.seed(250)
data_in = 2 * np.random.random(data_in_shape) - 1
result = model.predict(np.array([data_in]))
data_out_shape = result[0].shape
data_in_formatted = format_decimal(data_in.ravel().tolist())
data_out_formatted = format_decimal(result[0].ravel().tolist())
print('')
print('in shape:', data_in_shape)
print('in:', data_in_formatted)
print('out shape:', data_out_shape)
print('out:', data_out_formatted)

DATA['pooling.MaxPooling1D.0'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}


in shape: (6, 6)
in: [-0.570441, -0.454673, -0.285321, 0.237249, 0.282682, 0.428035, 0.160547, -0.332203, 0.546391, 0.272735, 0.010827, -0.763164, -0.442696, 0.381948, -0.676994, 0.753553, -0.031788, 0.915329, -0.738844, 0.269075, 0.434091, 0.991585, -0.944288, 0.258834, 0.162138, 0.565201, -0.492094, 0.170854, -0.139788, -0.710674, 0.406968, 0.705926, -0.094137, -0.793497, -0.040684, 0.522292]
out shape: (3, 6)
out: [0.160547, -0.332203, 0.546391, 0.272735, 0.282682, 0.428035, -0.442696, 0.381948, 0.434091, 0.991585, -0.031788, 0.915329, 0.406968, 0.705926, -0.094137, 0.170854, -0.040684, 0.522292]

[pooling.MaxPooling1D.1] input 6x6, pool_size=2, strides=1, padding='valid'


In [5]:
data_in_shape = (6, 6)
L = MaxPooling1D(pool_size=2, strides=1, padding='valid')

layer_0 = Input(shape=data_in_shape)
layer_1 = L(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)

# set weights to random (use seed for reproducibility)
np.random.seed(251)
data_in = 2 * np.random.random(data_in_shape) - 1
result = model.predict(np.array([data_in]))
data_out_shape = result[0].shape
data_in_formatted = format_decimal(data_in.ravel().tolist())
data_out_formatted = format_decimal(result[0].ravel().tolist())
print('')
print('in shape:', data_in_shape)
print('in:', data_in_formatted)
print('out shape:', data_out_shape)
print('out:', data_out_formatted)

DATA['pooling.MaxPooling1D.1'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}


in shape: (6, 6)
in: [0.275222, -0.793967, -0.468107, -0.841484, -0.295362, 0.78175, 0.068787, -0.261747, -0.625733, -0.042907, 0.861141, 0.85267, 0.956439, 0.717838, -0.99869, -0.963008, 0.013277, -0.180306, 0.832137, -0.385252, -0.524308, 0.659706, -0.905127, 0.526292, 0.832569, 0.084455, 0.23838, -0.046178, -0.735871, 0.776883, -0.394643, 0.498903, 0.029584, -0.17332, 0.628159, 0.445074]
out shape: (5, 6)
out: [0.275222, -0.261747, -0.468107, -0.042907, 0.861141, 0.85267, 0.956439, 0.717838, -0.625733, -0.042907, 0.861141, 0.85267, 0.956439, 0.717838, -0.524308, 0.659706, 0.013277, 0.526292, 0.832569, 0.084455, 0.23838, 0.659706, -0.735871, 0.776883, 0.832569, 0.498903, 0.23838, -0.046178, 0.628159, 0.776883]

[pooling.MaxPooling1D.2] input 6x6, pool_size=2, strides=3, padding='valid'


In [6]:
data_in_shape = (6, 6)
L = MaxPooling1D(pool_size=2, strides=3, padding='valid')

layer_0 = Input(shape=data_in_shape)
layer_1 = L(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)

# set weights to random (use seed for reproducibility)
np.random.seed(252)
data_in = 2 * np.random.random(data_in_shape) - 1
result = model.predict(np.array([data_in]))
data_out_shape = result[0].shape
data_in_formatted = format_decimal(data_in.ravel().tolist())
data_out_formatted = format_decimal(result[0].ravel().tolist())
print('')
print('in shape:', data_in_shape)
print('in:', data_in_formatted)
print('out shape:', data_out_shape)
print('out:', data_out_formatted)

DATA['pooling.MaxPooling1D.2'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}


in shape: (6, 6)
in: [-0.989173, -0.133618, -0.505338, 0.023259, 0.503982, -0.303769, -0.436321, 0.793911, 0.416102, 0.806405, -0.098342, -0.738022, -0.982676, 0.805073, 0.741244, -0.941634, -0.253526, -0.136544, -0.295772, 0.207565, -0.517246, -0.686963, -0.176235, -0.354111, -0.862411, -0.969822, 0.200074, 0.290718, -0.038623, 0.294839, 0.247968, 0.557946, -0.455596, 0.6624, 0.879529, -0.466772]
out shape: (2, 6)
out: [-0.436321, 0.793911, 0.416102, 0.806405, 0.503982, -0.303769, -0.295772, 0.207565, 0.200074, 0.290718, -0.038623, 0.294839]

[pooling.MaxPooling1D.3] input 6x6, pool_size=2, strides=None, padding='same'


In [7]:
data_in_shape = (6, 6)
L = MaxPooling1D(pool_size=2, strides=None, padding='same')

layer_0 = Input(shape=data_in_shape)
layer_1 = L(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)

# set weights to random (use seed for reproducibility)
np.random.seed(253)
data_in = 2 * np.random.random(data_in_shape) - 1
result = model.predict(np.array([data_in]))
data_out_shape = result[0].shape
data_in_formatted = format_decimal(data_in.ravel().tolist())
data_out_formatted = format_decimal(result[0].ravel().tolist())
print('')
print('in shape:', data_in_shape)
print('in:', data_in_formatted)
print('out shape:', data_out_shape)
print('out:', data_out_formatted)

DATA['pooling.MaxPooling1D.3'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}


in shape: (6, 6)
in: [-0.47588, 0.366985, 0.040173, 0.015578, -0.906159, 0.241982, -0.771299, -0.443554, -0.56404, -0.17751, 0.541277, -0.233327, 0.024369, 0.858275, 0.496191, 0.980574, -0.59522, 0.480899, 0.392553, -0.191718, 0.055121, 0.289836, -0.498339, 0.800408, 0.132679, -0.716649, 0.840092, -0.088837, -0.538209, -0.580887, -0.370128, -0.924933, -0.161736, -0.205619, 0.793729, -0.354472]
out shape: (3, 6)
out: [-0.47588, 0.366985, 0.040173, 0.015578, 0.541277, 0.241982, 0.392553, 0.858275, 0.496191, 0.980574, -0.498339, 0.800408, 0.132679, -0.716649, 0.840092, -0.088837, 0.793729, -0.354472]

[pooling.MaxPooling1D.4] input 6x6, pool_size=2, strides=1, padding='same'


In [8]:
data_in_shape = (6, 6)
L = MaxPooling1D(pool_size=2, strides=1, padding='same')

layer_0 = Input(shape=data_in_shape)
layer_1 = L(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)

# set weights to random (use seed for reproducibility)
np.random.seed(254)
data_in = 2 * np.random.random(data_in_shape) - 1
result = model.predict(np.array([data_in]))
data_out_shape = result[0].shape
data_in_formatted = format_decimal(data_in.ravel().tolist())
data_out_formatted = format_decimal(result[0].ravel().tolist())
print('')
print('in shape:', data_in_shape)
print('in:', data_in_formatted)
print('out shape:', data_out_shape)
print('out:', data_out_formatted)

DATA['pooling.MaxPooling1D.4'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}


in shape: (6, 6)
in: [0.024124, 0.280236, -0.680013, -0.042458, -0.164273, 0.358409, 0.511014, -0.585272, -0.481578, 0.692702, 0.64189, -0.400252, -0.922248, -0.735105, -0.533918, 0.071402, 0.310474, 0.369868, 0.767931, -0.842066, -0.091189, 0.835301, -0.480484, 0.950819, -0.002131, 0.086491, -0.480947, 0.405572, -0.083803, -0.921447, -0.291545, 0.674087, -0.560444, 0.881432, 0.076544, 0.63549]
out shape: (6, 6)
out: [0.511014, 0.280236, -0.481578, 0.692702, 0.64189, 0.358409, 0.511014, -0.585272, -0.481578, 0.692702, 0.64189, 0.369868, 0.767931, -0.735105, -0.091189, 0.835301, 0.310474, 0.950819, 0.767931, 0.086491, -0.091189, 0.835301, -0.083803, 0.950819, -0.002131, 0.674087, -0.480947, 0.881432, 0.076544, 0.63549, -0.291545, 0.674087, -0.560444, 0.881432, 0.076544, 0.63549]

[pooling.MaxPooling1D.5] input 6x6, pool_size=2, strides=3, padding='same'


In [9]:
data_in_shape = (6, 6)
L = MaxPooling1D(pool_size=2, strides=3, padding='same')

layer_0 = Input(shape=data_in_shape)
layer_1 = L(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)

# set weights to random (use seed for reproducibility)
np.random.seed(255)
data_in = 2 * np.random.random(data_in_shape) - 1
result = model.predict(np.array([data_in]))
data_out_shape = result[0].shape
data_in_formatted = format_decimal(data_in.ravel().tolist())
data_out_formatted = format_decimal(result[0].ravel().tolist())
print('')
print('in shape:', data_in_shape)
print('in:', data_in_formatted)
print('out shape:', data_out_shape)
print('out:', data_out_formatted)

DATA['pooling.MaxPooling1D.5'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}


in shape: (6, 6)
in: [-0.072127, -0.553929, -0.355552, -0.936405, 0.556627, -0.482815, -0.225337, -0.640315, 0.023246, -0.638412, -0.797304, 0.284959, -0.569771, -0.685286, 0.002481, 0.398436, 0.11345, 0.416629, -0.526713, 0.962183, 0.021732, 0.922994, 0.07991, -0.164385, 0.461494, -0.982877, -0.142158, 0.175741, -0.124041, -0.875609, -0.528708, -0.911127, 0.782257, -0.509403, 0.573973, -0.151309]
out shape: (2, 6)
out: [-0.072127, -0.553929, 0.023246, -0.638412, 0.556627, 0.284959, 0.461494, 0.962183, 0.021732, 0.922994, 0.07991, -0.164385]

[pooling.MaxPooling1D.6] input 6x6, pool_size=3, strides=None, padding='valid'


In [10]:
data_in_shape = (6, 6)
L = MaxPooling1D(pool_size=3, strides=None, padding='valid')

layer_0 = Input(shape=data_in_shape)
layer_1 = L(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)

# set weights to random (use seed for reproducibility)
np.random.seed(256)
data_in = 2 * np.random.random(data_in_shape) - 1
result = model.predict(np.array([data_in]))
data_out_shape = result[0].shape
data_in_formatted = format_decimal(data_in.ravel().tolist())
data_out_formatted = format_decimal(result[0].ravel().tolist())
print('')
print('in shape:', data_in_shape)
print('in:', data_in_formatted)
print('out shape:', data_out_shape)
print('out:', data_out_formatted)

DATA['pooling.MaxPooling1D.6'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}


in shape: (6, 6)
in: [-0.908432, 0.172241, -0.59352, -0.831514, -0.948016, -0.194126, -0.242576, -0.89432, 0.610714, -0.24071, -0.245859, 0.500851, 0.088791, 0.04635, 0.908568, -0.232197, -0.175815, -0.177919, -0.535898, 0.04802, 0.512585, 0.854168, 0.283045, 0.282488, -0.126263, 0.772568, 0.403228, 0.721107, -0.043311, -0.799013, -0.683105, -0.52703, 0.838417, 0.915738, 0.180207, -0.181716]
out shape: (2, 6)
out: [0.088791, 0.172241, 0.908568, -0.232197, -0.175815, 0.500851, -0.126263, 0.772568, 0.838417, 0.915738, 0.283045, 0.282488]

[pooling.MaxPooling1D.7] input 7x7, pool_size=3, strides=1, padding='same'


In [11]:
data_in_shape = (7, 7)
L = MaxPooling1D(pool_size=3, strides=1, padding='same')

layer_0 = Input(shape=data_in_shape)
layer_1 = L(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)

# set weights to random (use seed for reproducibility)
np.random.seed(257)
data_in = 2 * np.random.random(data_in_shape) - 1
result = model.predict(np.array([data_in]))
data_out_shape = result[0].shape
data_in_formatted = format_decimal(data_in.ravel().tolist())
data_out_formatted = format_decimal(result[0].ravel().tolist())
print('')
print('in shape:', data_in_shape)
print('in:', data_in_formatted)
print('out shape:', data_out_shape)
print('out:', data_out_formatted)

DATA['pooling.MaxPooling1D.7'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}


in shape: (7, 7)
in: [0.859653, 0.613312, 0.262871, 0.484585, 0.518061, -0.718848, -0.351388, -0.501557, 0.017192, -0.026869, -0.768317, -0.476893, -0.895809, 0.764782, 0.862057, 0.021243, 0.004039, 0.760431, 0.72102, 0.395305, 0.930351, 0.425255, -0.000952, -0.060338, -0.095258, 0.173776, -0.645557, 0.196502, 0.27885, -0.6868, -0.551196, 0.726361, -0.382779, 0.61877, 0.023847, -0.451251, 0.065412, -0.708225, -0.815011, -0.926643, 0.323493, -0.063352, 0.16365, -0.030438, -0.054635, 0.193949, -0.574495, 0.022988, 0.36335]
out shape: (7, 7)
out: [0.859653, 0.613312, 0.262871, 0.484585, 0.518061, -0.718848, 0.764782, 0.862057, 0.613312, 0.262871, 0.760431, 0.72102, 0.395305, 0.930351, 0.862057, 0.021243, 0.004039, 0.760431, 0.72102, 0.395305, 0.930351, 0.862057, 0.021243, 0.004039, 0.760431, 0.72102, 0.61877, 0.930351, 0.425255, 0.065412, -0.060338, 0.726361, 0.173776, 0.61877, 0.196502, 0.27885, 0.065412, -0.054635, 0.726361, -0.382779, 0.61877, 0.36335, 0.16365, 0.065412, -0.054635, 0.193949, -0.574495, 0.323493, 0.36335]

[pooling.MaxPooling1D.8] input 7x7, pool_size=3, strides=3, padding='same'


In [12]:
data_in_shape = (7, 7)
L = MaxPooling1D(pool_size=3, strides=3, padding='same')

layer_0 = Input(shape=data_in_shape)
layer_1 = L(layer_0)
model = Model(inputs=layer_0, outputs=layer_1)

# set weights to random (use seed for reproducibility)
np.random.seed(258)
data_in = 2 * np.random.random(data_in_shape) - 1
result = model.predict(np.array([data_in]))
data_out_shape = result[0].shape
data_in_formatted = format_decimal(data_in.ravel().tolist())
data_out_formatted = format_decimal(result[0].ravel().tolist())
print('')
print('in shape:', data_in_shape)
print('in:', data_in_formatted)
print('out shape:', data_out_shape)
print('out:', data_out_formatted)

DATA['pooling.MaxPooling1D.8'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}


in shape: (7, 7)
in: [-0.830746, 0.315868, -0.173506, 0.415541, -0.957882, 0.658995, 0.795264, -0.147083, -0.042061, 0.230065, 0.388847, -0.277524, -0.268423, 0.35691, -0.515291, -0.37555, 0.367489, 0.753251, -0.60764, -0.16741, -0.893275, -0.814508, -0.437352, 0.062193, -0.003077, 0.560767, -0.646034, -0.283879, 0.097661, 0.401756, -0.236235, -0.199824, -0.252007, -0.335503, 0.414988, 0.301686, 0.309765, -0.349835, -0.274081, 0.383308, -0.782973, -0.667924, 0.282556, -0.932491, 0.954125, 0.837689, 0.219229, -0.583405, -0.018424]
out shape: (3, 7)
out: [-0.147083, 0.315868, 0.230065, 0.415541, -0.277524, 0.658995, 0.795264, 0.097661, 0.401756, 0.367489, 0.753251, 0.560767, -0.16741, 0.414988, 0.301686, 0.309765, 0.954125, 0.837689, 0.383308, -0.583405, -0.018424]

export for Keras.js tests


In [13]:
import os

filename = '../../../test/data/layers/pooling/MaxPooling1D.json'
if not os.path.exists(os.path.dirname(filename)):
    os.makedirs(os.path.dirname(filename))
with open(filename, 'w') as f:
    json.dump(DATA, f)

In [14]:
print(json.dumps(DATA))


{"pooling.MaxPooling1D.0": {"input": {"data": [-0.570441, -0.454673, -0.285321, 0.237249, 0.282682, 0.428035, 0.160547, -0.332203, 0.546391, 0.272735, 0.010827, -0.763164, -0.442696, 0.381948, -0.676994, 0.753553, -0.031788, 0.915329, -0.738844, 0.269075, 0.434091, 0.991585, -0.944288, 0.258834, 0.162138, 0.565201, -0.492094, 0.170854, -0.139788, -0.710674, 0.406968, 0.705926, -0.094137, -0.793497, -0.040684, 0.522292], "shape": [6, 6]}, "expected": {"data": [0.160547, -0.332203, 0.546391, 0.272735, 0.282682, 0.428035, -0.442696, 0.381948, 0.434091, 0.991585, -0.031788, 0.915329, 0.406968, 0.705926, -0.094137, 0.170854, -0.040684, 0.522292], "shape": [3, 6]}}, "pooling.MaxPooling1D.1": {"input": {"data": [0.275222, -0.793967, -0.468107, -0.841484, -0.295362, 0.78175, 0.068787, -0.261747, -0.625733, -0.042907, 0.861141, 0.85267, 0.956439, 0.717838, -0.99869, -0.963008, 0.013277, -0.180306, 0.832137, -0.385252, -0.524308, 0.659706, -0.905127, 0.526292, 0.832569, 0.084455, 0.23838, -0.046178, -0.735871, 0.776883, -0.394643, 0.498903, 0.029584, -0.17332, 0.628159, 0.445074], "shape": [6, 6]}, "expected": {"data": [0.275222, -0.261747, -0.468107, -0.042907, 0.861141, 0.85267, 0.956439, 0.717838, -0.625733, -0.042907, 0.861141, 0.85267, 0.956439, 0.717838, -0.524308, 0.659706, 0.013277, 0.526292, 0.832569, 0.084455, 0.23838, 0.659706, -0.735871, 0.776883, 0.832569, 0.498903, 0.23838, -0.046178, 0.628159, 0.776883], "shape": [5, 6]}}, "pooling.MaxPooling1D.2": {"input": {"data": [-0.989173, -0.133618, -0.505338, 0.023259, 0.503982, -0.303769, -0.436321, 0.793911, 0.416102, 0.806405, -0.098342, -0.738022, -0.982676, 0.805073, 0.741244, -0.941634, -0.253526, -0.136544, -0.295772, 0.207565, -0.517246, -0.686963, -0.176235, -0.354111, -0.862411, -0.969822, 0.200074, 0.290718, -0.038623, 0.294839, 0.247968, 0.557946, -0.455596, 0.6624, 0.879529, -0.466772], "shape": [6, 6]}, "expected": {"data": [-0.436321, 0.793911, 0.416102, 0.806405, 0.503982, -0.303769, -0.295772, 0.207565, 0.200074, 0.290718, -0.038623, 0.294839], "shape": [2, 6]}}, "pooling.MaxPooling1D.3": {"input": {"data": [-0.47588, 0.366985, 0.040173, 0.015578, -0.906159, 0.241982, -0.771299, -0.443554, -0.56404, -0.17751, 0.541277, -0.233327, 0.024369, 0.858275, 0.496191, 0.980574, -0.59522, 0.480899, 0.392553, -0.191718, 0.055121, 0.289836, -0.498339, 0.800408, 0.132679, -0.716649, 0.840092, -0.088837, -0.538209, -0.580887, -0.370128, -0.924933, -0.161736, -0.205619, 0.793729, -0.354472], "shape": [6, 6]}, "expected": {"data": [-0.47588, 0.366985, 0.040173, 0.015578, 0.541277, 0.241982, 0.392553, 0.858275, 0.496191, 0.980574, -0.498339, 0.800408, 0.132679, -0.716649, 0.840092, -0.088837, 0.793729, -0.354472], "shape": [3, 6]}}, "pooling.MaxPooling1D.4": {"input": {"data": [0.024124, 0.280236, -0.680013, -0.042458, -0.164273, 0.358409, 0.511014, -0.585272, -0.481578, 0.692702, 0.64189, -0.400252, -0.922248, -0.735105, -0.533918, 0.071402, 0.310474, 0.369868, 0.767931, -0.842066, -0.091189, 0.835301, -0.480484, 0.950819, -0.002131, 0.086491, -0.480947, 0.405572, -0.083803, -0.921447, -0.291545, 0.674087, -0.560444, 0.881432, 0.076544, 0.63549], "shape": [6, 6]}, "expected": {"data": [0.511014, 0.280236, -0.481578, 0.692702, 0.64189, 0.358409, 0.511014, -0.585272, -0.481578, 0.692702, 0.64189, 0.369868, 0.767931, -0.735105, -0.091189, 0.835301, 0.310474, 0.950819, 0.767931, 0.086491, -0.091189, 0.835301, -0.083803, 0.950819, -0.002131, 0.674087, -0.480947, 0.881432, 0.076544, 0.63549, -0.291545, 0.674087, -0.560444, 0.881432, 0.076544, 0.63549], "shape": [6, 6]}}, "pooling.MaxPooling1D.5": {"input": {"data": [-0.072127, -0.553929, -0.355552, -0.936405, 0.556627, -0.482815, -0.225337, -0.640315, 0.023246, -0.638412, -0.797304, 0.284959, -0.569771, -0.685286, 0.002481, 0.398436, 0.11345, 0.416629, -0.526713, 0.962183, 0.021732, 0.922994, 0.07991, -0.164385, 0.461494, -0.982877, -0.142158, 0.175741, -0.124041, -0.875609, -0.528708, -0.911127, 0.782257, -0.509403, 0.573973, -0.151309], "shape": [6, 6]}, "expected": {"data": [-0.072127, -0.553929, 0.023246, -0.638412, 0.556627, 0.284959, 0.461494, 0.962183, 0.021732, 0.922994, 0.07991, -0.164385], "shape": [2, 6]}}, "pooling.MaxPooling1D.6": {"input": {"data": [-0.908432, 0.172241, -0.59352, -0.831514, -0.948016, -0.194126, -0.242576, -0.89432, 0.610714, -0.24071, -0.245859, 0.500851, 0.088791, 0.04635, 0.908568, -0.232197, -0.175815, -0.177919, -0.535898, 0.04802, 0.512585, 0.854168, 0.283045, 0.282488, -0.126263, 0.772568, 0.403228, 0.721107, -0.043311, -0.799013, -0.683105, -0.52703, 0.838417, 0.915738, 0.180207, -0.181716], "shape": [6, 6]}, "expected": {"data": [0.088791, 0.172241, 0.908568, -0.232197, -0.175815, 0.500851, -0.126263, 0.772568, 0.838417, 0.915738, 0.283045, 0.282488], "shape": [2, 6]}}, "pooling.MaxPooling1D.7": {"input": {"data": [0.859653, 0.613312, 0.262871, 0.484585, 0.518061, -0.718848, -0.351388, -0.501557, 0.017192, -0.026869, -0.768317, -0.476893, -0.895809, 0.764782, 0.862057, 0.021243, 0.004039, 0.760431, 0.72102, 0.395305, 0.930351, 0.425255, -0.000952, -0.060338, -0.095258, 0.173776, -0.645557, 0.196502, 0.27885, -0.6868, -0.551196, 0.726361, -0.382779, 0.61877, 0.023847, -0.451251, 0.065412, -0.708225, -0.815011, -0.926643, 0.323493, -0.063352, 0.16365, -0.030438, -0.054635, 0.193949, -0.574495, 0.022988, 0.36335], "shape": [7, 7]}, "expected": {"data": [0.859653, 0.613312, 0.262871, 0.484585, 0.518061, -0.718848, 0.764782, 0.862057, 0.613312, 0.262871, 0.760431, 0.72102, 0.395305, 0.930351, 0.862057, 0.021243, 0.004039, 0.760431, 0.72102, 0.395305, 0.930351, 0.862057, 0.021243, 0.004039, 0.760431, 0.72102, 0.61877, 0.930351, 0.425255, 0.065412, -0.060338, 0.726361, 0.173776, 0.61877, 0.196502, 0.27885, 0.065412, -0.054635, 0.726361, -0.382779, 0.61877, 0.36335, 0.16365, 0.065412, -0.054635, 0.193949, -0.574495, 0.323493, 0.36335], "shape": [7, 7]}}, "pooling.MaxPooling1D.8": {"input": {"data": [-0.830746, 0.315868, -0.173506, 0.415541, -0.957882, 0.658995, 0.795264, -0.147083, -0.042061, 0.230065, 0.388847, -0.277524, -0.268423, 0.35691, -0.515291, -0.37555, 0.367489, 0.753251, -0.60764, -0.16741, -0.893275, -0.814508, -0.437352, 0.062193, -0.003077, 0.560767, -0.646034, -0.283879, 0.097661, 0.401756, -0.236235, -0.199824, -0.252007, -0.335503, 0.414988, 0.301686, 0.309765, -0.349835, -0.274081, 0.383308, -0.782973, -0.667924, 0.282556, -0.932491, 0.954125, 0.837689, 0.219229, -0.583405, -0.018424], "shape": [7, 7]}, "expected": {"data": [-0.147083, 0.315868, 0.230065, 0.415541, -0.277524, 0.658995, 0.795264, 0.097661, 0.401756, 0.367489, 0.753251, 0.560767, -0.16741, 0.414988, 0.301686, 0.309765, 0.954125, 0.837689, 0.383308, -0.583405, -0.018424], "shape": [3, 7]}}}

In [ ]: