Package mdp :: Class CheckpointFlow
[hide private]
[frames] | no frames]

Class CheckpointFlow


Subclass of Flow class that allows user-supplied checkpoint functions to be executed at the end of each phase, for example to save the internal structures of a node for later analysis.
Instance Methods [hide private]
 
_train_check_checkpoints(self, checkpoints)
 
train(self, data_iterables, checkpoints)
Train all trainable nodes in the flow.

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

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

    Inherited from Flow
 
__add__(self, other)
 
__call__(self, iterable, nodenr=None)
Calling an instance is equivalent to call its 'execute' method.
 
__contains__(self, item)
 
__delitem__(self, key)
 
__getitem__(self, key)
 
__iadd__(self, other)
 
__init__(self, flow, crash_recovery=False, verbose=False)
Keyword arguments:
 
__iter__(self)
 
__len__(self)
 
__repr__(self)
repr(x)
 
__setitem__(self, key, value)
 
__str__(self)
str(x)
 
_check_dimension_consistency(self, out, inp)
Raise ValueError when both dimensions are set and different.
 
_check_nodes_consistency(self, flow=None)
Check the dimension consistency of a list of nodes.
 
_check_value_type_isnode(self, value)
 
_close_last_node(self)
 
_execute_seq(self, x, nodenr=None)
 
_inverse_seq(self, x)
 
_propagate_exception(self, except_, nodenr)
 
_stop_training_hook(self)
Hook method that is called before stop_training is called.
 
_train_check_iterables(self, data_iterables)
Return the data iterables after some checks and sanitizing.
 
_train_node(self, data_iterable, nodenr)
Train a single node in the flow.
 
append(flow, node)
append node to flow end
 
copy(self, protocol=None)
Return a deep copy of the flow.
 
execute(self, iterable, nodenr=None)
Process the data through all nodes in the flow.
 
extend(flow, iterable)
extend flow by appending elements from the iterable
 
insert(flow, index, node)
insert node before index
 
inverse(self, iterable)
Process the data through all nodes in the flow backwards (starting from the last node up to the first node) by calling the inverse function of each node. Of course, all nodes in the flow must be invertible.
node
pop(flow, index=...)
remove and return node at index (default last)
 
save(self, filename, protocol=-1)
Save a pickled serialization of the flow to 'filename'. If 'filename' is None, return a string.
 
set_crash_recovery(self, state=True)
Set crash recovery capabilities.
Static Methods [hide private]
    Inherited from Flow
 
_get_required_train_args(node)
Return arguments in addition to self and x for node.train.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_train_check_checkpoints(self, checkpoints)

 

train(self, data_iterables, checkpoints)

 

Train all trainable nodes in the flow.

In addition to the basic behavior (see 'Node.train'), calls the checkpoint function 'checkpoint[i]' when the training phase of node #i is over.

A checkpoint function takes as its only argument the trained node. If the checkpoint function returns a dictionary, its content is added to the instance dictionary.

The class CheckpointFunction can be used to define user-supplied checkpoint functions.

Overrides: Flow.train