Home | Trees | Indices | Help |
|
---|
|
An online Node (OnlineNode) is the basic building block of an online MDP application. It represents a data processing element, for example a learning algorithm, a data filter, or a visualization step. Each node has a training phase (optional), during which the internal structures are updated incrementally (or in batches) from training data (e.g. the weights of a neural network are adapted). Each node can also be executed at any point in time, where new data can be processed forwards (or backwards by applying the inverse of the transformation computed by the node if defined). Unlike a Node, an OnlineNode's execute (or inverse) call __does not__ end the training phase of the node. The training phase can only be stopped through an explicit 'stop_training' call. Once stopped, an OnlineNode becomes functionally equivalent to a trained Node. OnlineNode also supports multiple training phases. However, all the training_phases are active for each data point. See _train_seq documentation for more information. The training type of an OnlineNode can be set either to 'incremental' or 'batch'. When set to 'incremental', the input data array is passed for training sample by sample, while for 'batch' the entire data array is passed. An `OnlineNode` inherits all the Node's utility methods, for example `copy` and `save`, that returns an exact copy of a node and saves it in a file, respectively. Additional methods may be present, depending on the algorithm. OnlineNodes also support using a pre-seeded random number generator through a 'numx_rng' argument. This can be useful to replicate results. `OnlineNode` subclasses should take care of overwriting (if necessary) the functions `_train`, `_stop_training`, `_execute`, 'is_trainable', `is_invertible`, `_inverse`, `_get_supported_dtypes` and '_get_supported_training_types'. If you need to overwrite the getters and setters of the node's properties refer to the docstring of `get_input_dim`/`set_input_dim`, `get_output_dim`/`set_output_dim`, `get_dtype`/`set_dtype`, 'get_numx_rng'/'set_numx_rng'.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|||
Inherited from Node | |||
---|---|---|---|
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
Inherited from Node | |||
---|---|---|---|
|
|||
|
|
|||
_train_seq List of tuples:: |
|||
numx_rng Numpy seeded random number generator |
|||
training_type Training type (Read only) |
|||
Inherited from Node | |||
---|---|---|---|
dtype dtype |
|||
input_dim Input dimensions |
|||
output_dim Output dimensions |
|||
supported_dtypes Supported dtypes |
|
|
If the input dimension and the output dimension are unspecified, they will be set when the `train` or `execute` method is called for the first time. If dtype is unspecified, it will be inherited from the data it receives at the first call of `train` or `execute`. Every subclass must take care of up- or down-casting the internal structures to match this argument (use `_refcast` private method when possible). If numx_rng is unspecified, it will be set to a random number generator with a random seed.
|
|
|
|
Return the list of training types supported by this node. |
|
This method contains all pre-execution checks. It can be used when a subclass defines multiple execution methods.
|
This method contains all pre-inversion checks. It can be used when a subclass defines multiple inversion methods.
|
|
Return the index of the current training iteration. |
Return input dimensions. |
Set numx random number generator. Note that subclasses should overwrite `self._set_numx_rng` when needed. |
Sets the training type |
Stop the training phase. By default, subclasses should overwrite `_stop_training` to implement this functionality. The docstring of the `_stop_training` method overwrites this docstring.
|
Update the internal structures according to the input data `x`. `x` is a matrix having different variables on different columns and observations on the rows. By default, subclasses should overwrite `_train` to implement their training phase. The docstring of the `_train` method overwrites this docstring. Note: a subclass supporting multiple training phases should implement the *same* signature for all the training phases and document the meaning of the arguments in the `_train` method doc-string. Having consistent signatures is a requirement to use the node in a flow.
|
|
_train_seqList of tuples:: [(training-phase1, stop-training-phase1, execution-phase1), (training-phase2, stop_training-phase2, execution-phase2), ...] By default:: _train_seq = [(self._train, self._stop_training, Identity-function)] |
numx_rngNumpy seeded random number generator
|
training_typeTraining type (Read only) |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 | http://epydoc.sourceforge.net |