In [1]:
import numpy as np
from keras.models import Model
from keras.layers import Input
from keras.layers.convolutional import UpSampling3D
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()

UpSampling3D

[convolutional.UpSampling3D.0] size 2x2x2 upsampling on 2x2x2x3 input, data_format='channels_last'


In [4]:
data_in_shape = (2, 2, 2, 3)
L = UpSampling3D(size=(2, 2, 2), data_format='channels_last')

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(260)
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['convolutional.UpSampling3D.0'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}


in shape: (2, 2, 2, 3)
in: [-0.806777, -0.564841, -0.481331, 0.559626, 0.274958, -0.659222, -0.178541, 0.689453, -0.028873, 0.053859, -0.446394, -0.53406, 0.776897, -0.700858, -0.802179, -0.616515, 0.718677, 0.303042, -0.080606, -0.850593, -0.795971, 0.860487, -0.90685, 0.89858]
out shape: (4, 4, 4, 3)
out: [-0.806777, -0.564841, -0.481331, -0.806777, -0.564841, -0.481331, 0.559626, 0.274958, -0.659222, 0.559626, 0.274958, -0.659222, -0.806777, -0.564841, -0.481331, -0.806777, -0.564841, -0.481331, 0.559626, 0.274958, -0.659222, 0.559626, 0.274958, -0.659222, -0.178541, 0.689453, -0.028873, -0.178541, 0.689453, -0.028873, 0.053859, -0.446394, -0.53406, 0.053859, -0.446394, -0.53406, -0.178541, 0.689453, -0.028873, -0.178541, 0.689453, -0.028873, 0.053859, -0.446394, -0.53406, 0.053859, -0.446394, -0.53406, -0.806777, -0.564841, -0.481331, -0.806777, -0.564841, -0.481331, 0.559626, 0.274958, -0.659222, 0.559626, 0.274958, -0.659222, -0.806777, -0.564841, -0.481331, -0.806777, -0.564841, -0.481331, 0.559626, 0.274958, -0.659222, 0.559626, 0.274958, -0.659222, -0.178541, 0.689453, -0.028873, -0.178541, 0.689453, -0.028873, 0.053859, -0.446394, -0.53406, 0.053859, -0.446394, -0.53406, -0.178541, 0.689453, -0.028873, -0.178541, 0.689453, -0.028873, 0.053859, -0.446394, -0.53406, 0.053859, -0.446394, -0.53406, 0.776897, -0.700858, -0.802179, 0.776897, -0.700858, -0.802179, -0.616515, 0.718677, 0.303042, -0.616515, 0.718677, 0.303042, 0.776897, -0.700858, -0.802179, 0.776897, -0.700858, -0.802179, -0.616515, 0.718677, 0.303042, -0.616515, 0.718677, 0.303042, -0.080606, -0.850593, -0.795971, -0.080606, -0.850593, -0.795971, 0.860487, -0.90685, 0.89858, 0.860487, -0.90685, 0.89858, -0.080606, -0.850593, -0.795971, -0.080606, -0.850593, -0.795971, 0.860487, -0.90685, 0.89858, 0.860487, -0.90685, 0.89858, 0.776897, -0.700858, -0.802179, 0.776897, -0.700858, -0.802179, -0.616515, 0.718677, 0.303042, -0.616515, 0.718677, 0.303042, 0.776897, -0.700858, -0.802179, 0.776897, -0.700858, -0.802179, -0.616515, 0.718677, 0.303042, -0.616515, 0.718677, 0.303042, -0.080606, -0.850593, -0.795971, -0.080606, -0.850593, -0.795971, 0.860487, -0.90685, 0.89858, 0.860487, -0.90685, 0.89858, -0.080606, -0.850593, -0.795971, -0.080606, -0.850593, -0.795971, 0.860487, -0.90685, 0.89858, 0.860487, -0.90685, 0.89858]

[convolutional.UpSampling3D.1] size 2x2x2 upsampling on 2x2x2x3 input, data_format='channels_first'


In [5]:
data_in_shape = (2, 2, 2, 3)
L = UpSampling3D(size=(2, 2, 2), data_format='channels_first')

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(261)
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['convolutional.UpSampling3D.1'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}


in shape: (2, 2, 2, 3)
in: [0.601872, -0.028379, 0.654213, 0.217731, -0.864161, 0.422013, 0.888312, -0.714141, -0.184753, 0.224845, -0.221123, -0.847943, -0.511334, -0.871723, -0.597589, -0.889034, -0.544887, -0.004798, 0.406639, -0.35285, 0.648562, 0.325102, -0.691014, -0.77342]
out shape: (2, 4, 4, 6)
out: [0.601872, 0.601872, -0.028379, -0.028379, 0.654213, 0.654213, 0.601872, 0.601872, -0.028379, -0.028379, 0.654213, 0.654213, 0.217731, 0.217731, -0.864161, -0.864161, 0.422013, 0.422013, 0.217731, 0.217731, -0.864161, -0.864161, 0.422013, 0.422013, 0.601872, 0.601872, -0.028379, -0.028379, 0.654213, 0.654213, 0.601872, 0.601872, -0.028379, -0.028379, 0.654213, 0.654213, 0.217731, 0.217731, -0.864161, -0.864161, 0.422013, 0.422013, 0.217731, 0.217731, -0.864161, -0.864161, 0.422013, 0.422013, 0.888312, 0.888312, -0.714141, -0.714141, -0.184753, -0.184753, 0.888312, 0.888312, -0.714141, -0.714141, -0.184753, -0.184753, 0.224845, 0.224845, -0.221123, -0.221123, -0.847943, -0.847943, 0.224845, 0.224845, -0.221123, -0.221123, -0.847943, -0.847943, 0.888312, 0.888312, -0.714141, -0.714141, -0.184753, -0.184753, 0.888312, 0.888312, -0.714141, -0.714141, -0.184753, -0.184753, 0.224845, 0.224845, -0.221123, -0.221123, -0.847943, -0.847943, 0.224845, 0.224845, -0.221123, -0.221123, -0.847943, -0.847943, -0.511334, -0.511334, -0.871723, -0.871723, -0.597589, -0.597589, -0.511334, -0.511334, -0.871723, -0.871723, -0.597589, -0.597589, -0.889034, -0.889034, -0.544887, -0.544887, -0.004798, -0.004798, -0.889034, -0.889034, -0.544887, -0.544887, -0.004798, -0.004798, -0.511334, -0.511334, -0.871723, -0.871723, -0.597589, -0.597589, -0.511334, -0.511334, -0.871723, -0.871723, -0.597589, -0.597589, -0.889034, -0.889034, -0.544887, -0.544887, -0.004798, -0.004798, -0.889034, -0.889034, -0.544887, -0.544887, -0.004798, -0.004798, 0.406639, 0.406639, -0.35285, -0.35285, 0.648562, 0.648562, 0.406639, 0.406639, -0.35285, -0.35285, 0.648562, 0.648562, 0.325102, 0.325102, -0.691014, -0.691014, -0.77342, -0.77342, 0.325102, 0.325102, -0.691014, -0.691014, -0.77342, -0.77342, 0.406639, 0.406639, -0.35285, -0.35285, 0.648562, 0.648562, 0.406639, 0.406639, -0.35285, -0.35285, 0.648562, 0.648562, 0.325102, 0.325102, -0.691014, -0.691014, -0.77342, -0.77342, 0.325102, 0.325102, -0.691014, -0.691014, -0.77342, -0.77342]

[convolutional.UpSampling3D.2] size 1x3x2 upsampling on 2x1x3x2 input, data_format='channels_last'


In [6]:
data_in_shape = (2, 1, 3, 2)
L = UpSampling3D(size=(1, 3, 2), data_format='channels_last')

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['convolutional.UpSampling3D.2'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}


in shape: (2, 1, 3, 2)
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]
out shape: (2, 3, 6, 2)
out: [-0.989173, -0.133618, -0.989173, -0.133618, -0.505338, 0.023259, -0.505338, 0.023259, 0.503982, -0.303769, 0.503982, -0.303769, -0.989173, -0.133618, -0.989173, -0.133618, -0.505338, 0.023259, -0.505338, 0.023259, 0.503982, -0.303769, 0.503982, -0.303769, -0.989173, -0.133618, -0.989173, -0.133618, -0.505338, 0.023259, -0.505338, 0.023259, 0.503982, -0.303769, 0.503982, -0.303769, -0.436321, 0.793911, -0.436321, 0.793911, 0.416102, 0.806405, 0.416102, 0.806405, -0.098342, -0.738022, -0.098342, -0.738022, -0.436321, 0.793911, -0.436321, 0.793911, 0.416102, 0.806405, 0.416102, 0.806405, -0.098342, -0.738022, -0.098342, -0.738022, -0.436321, 0.793911, -0.436321, 0.793911, 0.416102, 0.806405, 0.416102, 0.806405, -0.098342, -0.738022, -0.098342, -0.738022]

[convolutional.UpSampling3D.3] size 2x1x2 upsampling on 2x1x3x3 input, data_format='channels_first'


In [7]:
data_in_shape = (2, 1, 3, 3)
L = UpSampling3D(size=(2, 1, 2), data_format='channels_first')

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['convolutional.UpSampling3D.3'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}


in shape: (2, 1, 3, 3)
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]
out shape: (2, 2, 3, 6)
out: [-0.47588, -0.47588, 0.366985, 0.366985, 0.040173, 0.040173, 0.015578, 0.015578, -0.906159, -0.906159, 0.241982, 0.241982, -0.771299, -0.771299, -0.443554, -0.443554, -0.56404, -0.56404, -0.47588, -0.47588, 0.366985, 0.366985, 0.040173, 0.040173, 0.015578, 0.015578, -0.906159, -0.906159, 0.241982, 0.241982, -0.771299, -0.771299, -0.443554, -0.443554, -0.56404, -0.56404, -0.17751, -0.17751, 0.541277, 0.541277, -0.233327, -0.233327, 0.024369, 0.024369, 0.858275, 0.858275, 0.496191, 0.496191, 0.980574, 0.980574, -0.59522, -0.59522, 0.480899, 0.480899, -0.17751, -0.17751, 0.541277, 0.541277, -0.233327, -0.233327, 0.024369, 0.024369, 0.858275, 0.858275, 0.496191, 0.496191, 0.980574, 0.980574, -0.59522, -0.59522, 0.480899, 0.480899]

[convolutional.UpSampling3D.4] size 2 upsampling on 2x1x3x2 input, data_format='channels_last'


In [8]:
data_in_shape = (2, 1, 3, 2)
L = UpSampling3D(size=2, data_format='channels_last')

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['convolutional.UpSampling3D.4'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}


in shape: (2, 1, 3, 2)
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]
out shape: (4, 2, 6, 2)
out: [0.024124, 0.280236, 0.024124, 0.280236, -0.680013, -0.042458, -0.680013, -0.042458, -0.164273, 0.358409, -0.164273, 0.358409, 0.024124, 0.280236, 0.024124, 0.280236, -0.680013, -0.042458, -0.680013, -0.042458, -0.164273, 0.358409, -0.164273, 0.358409, 0.024124, 0.280236, 0.024124, 0.280236, -0.680013, -0.042458, -0.680013, -0.042458, -0.164273, 0.358409, -0.164273, 0.358409, 0.024124, 0.280236, 0.024124, 0.280236, -0.680013, -0.042458, -0.680013, -0.042458, -0.164273, 0.358409, -0.164273, 0.358409, 0.511014, -0.585272, 0.511014, -0.585272, -0.481578, 0.692702, -0.481578, 0.692702, 0.64189, -0.400252, 0.64189, -0.400252, 0.511014, -0.585272, 0.511014, -0.585272, -0.481578, 0.692702, -0.481578, 0.692702, 0.64189, -0.400252, 0.64189, -0.400252, 0.511014, -0.585272, 0.511014, -0.585272, -0.481578, 0.692702, -0.481578, 0.692702, 0.64189, -0.400252, 0.64189, -0.400252, 0.511014, -0.585272, 0.511014, -0.585272, -0.481578, 0.692702, -0.481578, 0.692702, 0.64189, -0.400252, 0.64189, -0.400252]

export for Keras.js tests


In [9]:
import os

filename = '../../../test/data/layers/convolutional/UpSampling3D.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 [10]:
print(json.dumps(DATA))


{"convolutional.UpSampling3D.0": {"input": {"data": [-0.806777, -0.564841, -0.481331, 0.559626, 0.274958, -0.659222, -0.178541, 0.689453, -0.028873, 0.053859, -0.446394, -0.53406, 0.776897, -0.700858, -0.802179, -0.616515, 0.718677, 0.303042, -0.080606, -0.850593, -0.795971, 0.860487, -0.90685, 0.89858], "shape": [2, 2, 2, 3]}, "expected": {"data": [-0.806777, -0.564841, -0.481331, -0.806777, -0.564841, -0.481331, 0.559626, 0.274958, -0.659222, 0.559626, 0.274958, -0.659222, -0.806777, -0.564841, -0.481331, -0.806777, -0.564841, -0.481331, 0.559626, 0.274958, -0.659222, 0.559626, 0.274958, -0.659222, -0.178541, 0.689453, -0.028873, -0.178541, 0.689453, -0.028873, 0.053859, -0.446394, -0.53406, 0.053859, -0.446394, -0.53406, -0.178541, 0.689453, -0.028873, -0.178541, 0.689453, -0.028873, 0.053859, -0.446394, -0.53406, 0.053859, -0.446394, -0.53406, -0.806777, -0.564841, -0.481331, -0.806777, -0.564841, -0.481331, 0.559626, 0.274958, -0.659222, 0.559626, 0.274958, -0.659222, -0.806777, -0.564841, -0.481331, -0.806777, -0.564841, -0.481331, 0.559626, 0.274958, -0.659222, 0.559626, 0.274958, -0.659222, -0.178541, 0.689453, -0.028873, -0.178541, 0.689453, -0.028873, 0.053859, -0.446394, -0.53406, 0.053859, -0.446394, -0.53406, -0.178541, 0.689453, -0.028873, -0.178541, 0.689453, -0.028873, 0.053859, -0.446394, -0.53406, 0.053859, -0.446394, -0.53406, 0.776897, -0.700858, -0.802179, 0.776897, -0.700858, -0.802179, -0.616515, 0.718677, 0.303042, -0.616515, 0.718677, 0.303042, 0.776897, -0.700858, -0.802179, 0.776897, -0.700858, -0.802179, -0.616515, 0.718677, 0.303042, -0.616515, 0.718677, 0.303042, -0.080606, -0.850593, -0.795971, -0.080606, -0.850593, -0.795971, 0.860487, -0.90685, 0.89858, 0.860487, -0.90685, 0.89858, -0.080606, -0.850593, -0.795971, -0.080606, -0.850593, -0.795971, 0.860487, -0.90685, 0.89858, 0.860487, -0.90685, 0.89858, 0.776897, -0.700858, -0.802179, 0.776897, -0.700858, -0.802179, -0.616515, 0.718677, 0.303042, -0.616515, 0.718677, 0.303042, 0.776897, -0.700858, -0.802179, 0.776897, -0.700858, -0.802179, -0.616515, 0.718677, 0.303042, -0.616515, 0.718677, 0.303042, -0.080606, -0.850593, -0.795971, -0.080606, -0.850593, -0.795971, 0.860487, -0.90685, 0.89858, 0.860487, -0.90685, 0.89858, -0.080606, -0.850593, -0.795971, -0.080606, -0.850593, -0.795971, 0.860487, -0.90685, 0.89858, 0.860487, -0.90685, 0.89858], "shape": [4, 4, 4, 3]}}, "convolutional.UpSampling3D.1": {"input": {"data": [0.601872, -0.028379, 0.654213, 0.217731, -0.864161, 0.422013, 0.888312, -0.714141, -0.184753, 0.224845, -0.221123, -0.847943, -0.511334, -0.871723, -0.597589, -0.889034, -0.544887, -0.004798, 0.406639, -0.35285, 0.648562, 0.325102, -0.691014, -0.77342], "shape": [2, 2, 2, 3]}, "expected": {"data": [0.601872, 0.601872, -0.028379, -0.028379, 0.654213, 0.654213, 0.601872, 0.601872, -0.028379, -0.028379, 0.654213, 0.654213, 0.217731, 0.217731, -0.864161, -0.864161, 0.422013, 0.422013, 0.217731, 0.217731, -0.864161, -0.864161, 0.422013, 0.422013, 0.601872, 0.601872, -0.028379, -0.028379, 0.654213, 0.654213, 0.601872, 0.601872, -0.028379, -0.028379, 0.654213, 0.654213, 0.217731, 0.217731, -0.864161, -0.864161, 0.422013, 0.422013, 0.217731, 0.217731, -0.864161, -0.864161, 0.422013, 0.422013, 0.888312, 0.888312, -0.714141, -0.714141, -0.184753, -0.184753, 0.888312, 0.888312, -0.714141, -0.714141, -0.184753, -0.184753, 0.224845, 0.224845, -0.221123, -0.221123, -0.847943, -0.847943, 0.224845, 0.224845, -0.221123, -0.221123, -0.847943, -0.847943, 0.888312, 0.888312, -0.714141, -0.714141, -0.184753, -0.184753, 0.888312, 0.888312, -0.714141, -0.714141, -0.184753, -0.184753, 0.224845, 0.224845, -0.221123, -0.221123, -0.847943, -0.847943, 0.224845, 0.224845, -0.221123, -0.221123, -0.847943, -0.847943, -0.511334, -0.511334, -0.871723, -0.871723, -0.597589, -0.597589, -0.511334, -0.511334, -0.871723, -0.871723, -0.597589, -0.597589, -0.889034, -0.889034, -0.544887, -0.544887, -0.004798, -0.004798, -0.889034, -0.889034, -0.544887, -0.544887, -0.004798, -0.004798, -0.511334, -0.511334, -0.871723, -0.871723, -0.597589, -0.597589, -0.511334, -0.511334, -0.871723, -0.871723, -0.597589, -0.597589, -0.889034, -0.889034, -0.544887, -0.544887, -0.004798, -0.004798, -0.889034, -0.889034, -0.544887, -0.544887, -0.004798, -0.004798, 0.406639, 0.406639, -0.35285, -0.35285, 0.648562, 0.648562, 0.406639, 0.406639, -0.35285, -0.35285, 0.648562, 0.648562, 0.325102, 0.325102, -0.691014, -0.691014, -0.77342, -0.77342, 0.325102, 0.325102, -0.691014, -0.691014, -0.77342, -0.77342, 0.406639, 0.406639, -0.35285, -0.35285, 0.648562, 0.648562, 0.406639, 0.406639, -0.35285, -0.35285, 0.648562, 0.648562, 0.325102, 0.325102, -0.691014, -0.691014, -0.77342, -0.77342, 0.325102, 0.325102, -0.691014, -0.691014, -0.77342, -0.77342], "shape": [2, 4, 4, 6]}}, "convolutional.UpSampling3D.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], "shape": [2, 1, 3, 2]}, "expected": {"data": [-0.989173, -0.133618, -0.989173, -0.133618, -0.505338, 0.023259, -0.505338, 0.023259, 0.503982, -0.303769, 0.503982, -0.303769, -0.989173, -0.133618, -0.989173, -0.133618, -0.505338, 0.023259, -0.505338, 0.023259, 0.503982, -0.303769, 0.503982, -0.303769, -0.989173, -0.133618, -0.989173, -0.133618, -0.505338, 0.023259, -0.505338, 0.023259, 0.503982, -0.303769, 0.503982, -0.303769, -0.436321, 0.793911, -0.436321, 0.793911, 0.416102, 0.806405, 0.416102, 0.806405, -0.098342, -0.738022, -0.098342, -0.738022, -0.436321, 0.793911, -0.436321, 0.793911, 0.416102, 0.806405, 0.416102, 0.806405, -0.098342, -0.738022, -0.098342, -0.738022, -0.436321, 0.793911, -0.436321, 0.793911, 0.416102, 0.806405, 0.416102, 0.806405, -0.098342, -0.738022, -0.098342, -0.738022], "shape": [2, 3, 6, 2]}}, "convolutional.UpSampling3D.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], "shape": [2, 1, 3, 3]}, "expected": {"data": [-0.47588, -0.47588, 0.366985, 0.366985, 0.040173, 0.040173, 0.015578, 0.015578, -0.906159, -0.906159, 0.241982, 0.241982, -0.771299, -0.771299, -0.443554, -0.443554, -0.56404, -0.56404, -0.47588, -0.47588, 0.366985, 0.366985, 0.040173, 0.040173, 0.015578, 0.015578, -0.906159, -0.906159, 0.241982, 0.241982, -0.771299, -0.771299, -0.443554, -0.443554, -0.56404, -0.56404, -0.17751, -0.17751, 0.541277, 0.541277, -0.233327, -0.233327, 0.024369, 0.024369, 0.858275, 0.858275, 0.496191, 0.496191, 0.980574, 0.980574, -0.59522, -0.59522, 0.480899, 0.480899, -0.17751, -0.17751, 0.541277, 0.541277, -0.233327, -0.233327, 0.024369, 0.024369, 0.858275, 0.858275, 0.496191, 0.496191, 0.980574, 0.980574, -0.59522, -0.59522, 0.480899, 0.480899], "shape": [2, 2, 3, 6]}}, "convolutional.UpSampling3D.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], "shape": [2, 1, 3, 2]}, "expected": {"data": [0.024124, 0.280236, 0.024124, 0.280236, -0.680013, -0.042458, -0.680013, -0.042458, -0.164273, 0.358409, -0.164273, 0.358409, 0.024124, 0.280236, 0.024124, 0.280236, -0.680013, -0.042458, -0.680013, -0.042458, -0.164273, 0.358409, -0.164273, 0.358409, 0.024124, 0.280236, 0.024124, 0.280236, -0.680013, -0.042458, -0.680013, -0.042458, -0.164273, 0.358409, -0.164273, 0.358409, 0.024124, 0.280236, 0.024124, 0.280236, -0.680013, -0.042458, -0.680013, -0.042458, -0.164273, 0.358409, -0.164273, 0.358409, 0.511014, -0.585272, 0.511014, -0.585272, -0.481578, 0.692702, -0.481578, 0.692702, 0.64189, -0.400252, 0.64189, -0.400252, 0.511014, -0.585272, 0.511014, -0.585272, -0.481578, 0.692702, -0.481578, 0.692702, 0.64189, -0.400252, 0.64189, -0.400252, 0.511014, -0.585272, 0.511014, -0.585272, -0.481578, 0.692702, -0.481578, 0.692702, 0.64189, -0.400252, 0.64189, -0.400252, 0.511014, -0.585272, 0.511014, -0.585272, -0.481578, 0.692702, -0.481578, 0.692702, 0.64189, -0.400252, 0.64189, -0.400252], "shape": [4, 2, 6, 2]}}}

In [ ]: