As the title states, why doesn't timeseries_dataset_from_array()
add an extra dimension to the output?
print("data shape" , data[0].shape)
print("target shape" , targets[0].shape)
ds = tf.keras.preprocessing.timeseries_dataset_from_array(
data=data,
targets=targets,
sequence_length=5,
sequence_stride=1,
shuffle=True,
batch_size=32,)
print("ds shape ", ds.element_spec)
Output:
data shape (224, 304, 2)
target shape (12,)
ds shape (TensorSpec(shape=(None, None, 224, 304, 2), dtype=tf.float32, name=None), TensorSpec(shape=(None, 12), dtype=tf.float32, name=None))