View source on GitHub |
Utility class for generating batches of temporal data.
Inherits From: PyDataset
tf.keras.preprocessing.sequence.TimeseriesGenerator(
data,
targets,
length,
sampling_rate=1,
stride=1,
start_index=0,
end_index=None,
shuffle=False,
reverse=False,
batch_size=128
)
DEPRECATED.
This class takes in a sequence of data-points gathered at equal intervals, along with time series parameters such as stride, length of history, etc., to produce batches for training/validation.
Returns | |
---|---|
A PyDataset instance. |
Attributes | |
---|---|
max_queue_size
|
|
num_batches
|
Number of batches in the PyDataset. |
use_multiprocessing
|
|
workers
|
Methods
get_config
get_config()
Returns the TimeseriesGenerator configuration as Python dictionary.
Returns | |
---|---|
A Python dictionary with the TimeseriesGenerator configuration. |
on_epoch_end
on_epoch_end()
Method called at the end of every epoch.
to_json
to_json(
**kwargs
)
Returns a JSON string containing the generator's configuration.
Args | |
---|---|
**kwargs
|
Additional keyword arguments to be passed
to json.dumps() .
|
Returns | |
---|---|
A JSON string containing the tokenizer configuration. |
__getitem__
__getitem__(
index
)
Gets batch at position index
.
Args | |
---|---|
index
|
position of the batch in the PyDataset. |
Returns | |
---|---|
A batch |
__len__
__len__()