<jupyter_start><jupyter_text>UpSampling1D **[convolutional.UpSampling1D.0] size 2 upsampling on 3x5 input**<jupyter_code>data_in_shape = (3, 5)
L = UpSampling1D(size=2)

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(230)
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.UpSampling1D.0'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}<jupyter_output>in shape: (3, 5)
in: [0.262, 0.764609, -0.482897, -0.371755, 0.871769, 0.490033, -0.986894, -0.960468, 0.373039, 0.911356, 0.00298, 0.270652, 0.749006, 0.692235, 0.471778]
out shape: (6, 5)
out: [0.262, 0.764609, -0.482897, -0.371755, 0.871769, 0.262, 0.764609, -0.482897, -0.371755, 0.871769, 0.490033, -0.986894, -0.960468, 0.373039, 0.911356, 0.490033, -0.986894, -0.960468, 0.373039, 0.911356, 0.00298, 0.270652, 0.749006, 0.692235, 0.471778, 0.00298, 0.270652, 0.749006, 0.692235, 0.471778]<jupyter_text>**[convolutional.UpSampling1D.1] size 3 upsampling on 4x4 input**<jupyter_code>data_in_shape = (4, 4)
L = UpSampling1D(size=3)

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(231)
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.UpSampling1D.1'] = {
    'input': {'data': data_in_formatted, 'shape': data_in_shape},
    'expected': {'data': data_out_formatted, 'shape': data_out_shape}
}<jupyter_output>in shape: (4, 4)
in: [0.562988, 0.168418, -0.14658, -0.369311, 0.653777, 0.806859, -0.922124, 0.830445, -0.878989, -0.638546, -0.855401, -0.082476, 0.416718, -0.03353, -0.949107, -0.866195]
out shape: (12, 4)
out: [0.562988, 0.168418, -0.14658, -0.369311, 0.562988, 0.168418, -0.14658, -0.369311, 0.562988, 0.168418, -0.14658, -0.369311, 0.653777, 0.806859, -0.922124, 0.830445, 0.653777, 0.806859, -0.922124, 0.830445, 0.653777, 0.806859, -0.922124, 0.830445, -0.878989, -0.638546, -0.855401, -0.082476, -0.878989, -0.638546, -0.855401, -0.082476, -0.878989, -0.638546, -0.855401, -0.082476, 0.416718, -0.03353, -0.949107, -0.866195, 0.416718, -0.03353, -0.949107, -0.866195, 0.416718, -0.03353, -0.949107, -0.866195]<jupyter_text>export for Keras.js tests<jupyter_code>print(json.dumps(DATA))<jupyter_output>{"convolutional.UpSampling1D.0": {"input": {"shape": [3, 5], "data": [0.262, 0.764609, -0.482897, -0.371755, 0.871769, 0.490033, -0.986894, -0.960468, 0.373039, 0.911356, 0.00298, 0.270652, 0.749006, 0.692235, 0.471778]}, "expected": {"shape": [6, 5], "data": [0.262, 0.764609, -0.482897, -0.371755, 0.871769, 0.262, 0.764609, -0.482897, -0.371755, 0.871769, 0.490033, -0.986894, -0.960468, 0.373039, 0.911356, 0.490033, -0.986894, -0.960468, 0.373039, 0.911356, 0.00298, 0.270652, 0.749006, 0.692235, 0.471778, 0.00298, 0.270652, 0.749006, 0.692235, 0.471778]}}, "convolutional.UpSampling1D.1": {"input": {"shape": [4, 4], "data": [0.562988, 0.168418, -0.14658, -0.369311, 0.653777, 0.806859, -0.922124, 0.830445, -0.878989, -0.638546, -0.855401, -0.082476, 0.416718, -0.03353, -0.949107, -0.866195]}, "expected": {"shape": [12, 4], "data": [0.562988, 0.168418, -0.14658, -0.369311, 0.562988, 0.168418, -0.14658, -0.369311, 0.562988, 0.168418, -0.14658, -0.369311, 0.653777, 0.806859, -0.922124, 0.8[...]
{'fraction_non_alphanumeric': 0.20695443645083933, 'fraction_numerical': 0.318705035971223, 'mean_word_length': 4.85814606741573, 'pattern_counts': {'":': 14, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '536004', 'license': 'MIT', 'n_tokens_mistral': 2746, 'n_tokens_neox': 2030, 'n_words': 352, 'path': 'notebooks/layers/convolutional/UpSampling1D.ipynb', 'repo_name': 'GTDev87/tpt-hackathon', 'size': '4170'}