twodlearn.templates.recurrent module

class twodlearn.templates.recurrent.Mlp2LstmEstimator(options=None, logger_path='tmp', session=None, **kargs)[source]

Bases: twodlearn.templates.supervised.SupervisedEstimator

build_graph(init_x0, init_inputs, n_unrollings, batch_size)[source]
fit(dataset, max_iter=100, batch_size=100, feed_train=None, feed_valid=None)[source]
model[source]
monitor[source]

Decorator used to specify an optional property inside a model. The decorator works similar to @property, but the specified method correponds to the initialization of the property

normalizer[source]

Autoinit with arguments [‘dataset’]

predict(x0, inputs)[source]
test[source]

Autoinit with arguments [‘n_unrollings’]

train[source]

Autoinit with arguments [‘n_unrollings’, ‘regularizer_scale’]

visualize_fit(dataset, n_steps=None, ax=None)[source]
visualize_predictions(x0, inputs, targets, ax=None)[source]
twodlearn.templates.recurrent.next_batch_for_narx(dataset, window_size, n_steps, batch_size)[source]

Returns a batch in a narx format: x0, y, inputs. :param dataset: time series dataset. :type dataset: TSDataset :param window_size: number of steps to include in x0. :type window_size: int :param n_steps: number of steps to include in y and u. :type n_steps: int :param batch_size: number of samples in the batch. :type batch_size: int

Returns

batch.

Return type

(x0, y, u)