Package mdp :: Package parallel :: Class FlowTrainCallable
[hide private]
[frames] | no frames]

Class FlowTrainCallable


Implements a single training phase in a flow for a data block.

A FlowNode is used to simplify the forking process and to
encapsulate the flow.

You can also derive from this class to define your own callable class.

Instance Methods [hide private]
 
__call__(self, data)
Do the training and return only the trained node.
 
__init__(self, flownode, purge_nodes=True)
Store everything for the training.
 
fork(self)
Return a fork of this callable, e.g.

Inherited from unreachable.newobject: __long__, __native__, __nonzero__, __unicode__, next

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

    Inherited from FlowTaskCallable
 
setup_environment(self)
Activate the used extensions.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__call__(self, data)
(Call operator)

 
Do the training and return only the trained node.

data -- training data block (array or list if additional arguments are
    required)

Overrides: TaskCallable.__call__

__init__(self, flownode, purge_nodes=True)
(Constructor)

 
Store everything for the training.

keyword arguments:
flownode -- FlowNode containing the flow to be trained.
purge_nodes -- If True nodes not needed for the join will be replaced
    with dummy nodes to reduce the footprint.

Overrides: object.__init__

fork(self)

 
Return a fork of this callable, e.g. by making a copy.

This method is always called exactly once before a callable is called,
so instead of the original callable a fresh fork is called. This
ensures that the original callable is preserved when caching is used.
If the callable is not modified by the call then it can simply return
itself.

Overrides: TaskCallable.fork
(inherited documentation)