Home | Trees | Indices | Help |
|
---|
|
A 'CircularOnlineFlow' is a cyclic sequence of online/non-trainable nodes that are trained and executed together to form a more complex algorithm. This type of flow is useful when one needs to train the nodes internally for several iterations using stored inputs before training with the next external input. input=x(i) -> [node1, node2, node3] -> output=y' ----External input training---- (1 iteration) input=y' -> [node1, node2, node3] -> output=y' ---- Internal ... input (n-1 iterations) input=y' -> [node1, node2, node3] -> output=y(i) training---- This type of processing is especially useful for implementing control algorithms, reinforcement learning, etc. The input and the output nodes of the flow can be changed at any time using the functions "set_input_node" and "set_output_node". Examples: If input node and output node are set equal to node1 : Input -> [node1] -> output / [node3] <- [node2] If input node = node1 and output node is equal to node2 Input -> [node1] -> [node2] -> output \ / [node3] CircularOnlineFlow also supports training nodes while ignoring external input data at all times. In this case, the flow iterates everytime using the previously stored output as the input. Input data can be arbitrary (with same input_dim and dtype) and is only used as a clock signal to trigger flow processing. See the docstring of the train method for more information about different training types. Crash recovery is optionally available: in case of failure the current state of the flow is saved for later inspection. CircularOnlineFlow objects are Python containers. Most of the builtin 'list' methods are available. CircularOnlineFlow can be saved or copied using the corresponding 'save' and 'copy' methods.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|||
Inherited from OnlineFlow | |||
---|---|---|---|
|
|||
|
|||
|
|||
|
|||
Inherited from Flow | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
node |
|
||
|
|||
|
|
|||
Inherited from Flow | |||
---|---|---|---|
|
|
|
|
|
|
flow - a list of nodes.
|
|
|
|
|
append node to flow end
|
Process the data through all nodes between input and the output node. This is functionally similar to the execute method of an OnlineFlow. 'iterable' is an iterable or iterator (note that a list is also an iterable), which returns data arrays that are used as input to the flow. Alternatively, one can specify one data array as input.
|
extend flow by appending elements from the iterable
|
return the current stored input |
CircularOnlineFlow also supports training nodes while ignoring external input data at all times. This mode is enabled/disabled using this method. See train method docstring for information on different training modes. |
insert node before index
|
Resets the output node to the last node of the provided node sequence |
This method sets the number of total flow iterations: If self._ignore_input is False, then the total flow iterations = 1 external + (n-1) internal iterations. If self._ignore input is True, then the total flow iterations = n internal iterations. See train method docstring for information on different training modes. |
Set the input node of the flow |
Set the output node of the flow |
CircularOnlineFlow also supports training nodes while ignoring external input data at all times. In this case, the flow iterates every time using an initially stored input that can be set using this method. |
Train all trainable-nodes in the flow. 'data_iterables' is a single iterable (including generator-type iterators) that must return data arrays to train nodes (so the data arrays are the 'x' for the nodes). Note that the data arrays are processed by the nodes which are in front of the node that gets trained, so the data dimension must match the input dimension of the first node. 'data_iterables' can also be a 2D or a 3D numpy array. A 2D array trains all the nodes incrementally, while a 3D array supports online training in batches (=shape[1]). Circular flow does not support passing training arguments. There are three ways that the training can proceed based on the values of self._ignore_input (default=False, can be set via 'ignore_input' method) and self._flow_iterations argument (default=1, can be set via 'set_flow_iterations' method). 1) self._ignore_input = False, self._flow_iterations = 1 (default case) This is functionally similar to the standard OnlineFlow. Each data array returned by the data_iterables is used to train the nodes simultaneously. 2) self._ignore_input = False, self._flow_iterations > 1 For each data_array returned by the data_iterables, the flow trains 1 loop with the data_array and 'self._flow_iterations-1' loops with the updating stored inputs. 3) self._ignore_input = True, self._flow_iterations > 1 The data_arrays returned by the data_iterables are ignored, however, for each data_array, the flow trains 'self._flow_iterations' loops with the updating stored inputs.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 | http://epydoc.sourceforge.net |