| Home | Trees | Index | Help |
|
|---|
| Package pyrobot :: Package brain :: Module conx :: Class SRN |
|
Network --+
|
SRN
GovernorSRNA subclass of Network. SRN allows for simple recursive networks by copying hidden activations back to a context layer. This subclass adds support for sequencing, prediction, and context layers.
| Method Summary | |
|---|---|
Constructor for SRN sub-class. | |
Adds a context layer. | |
addContextLayer(self,
name,
size,
hiddenLayerName,
verbosity)
| |
Wraps SRN.addThreeLayers() for compatibility. | |
Creates a three level network with a context layer. | |
Extends backprop() from Network to automatically deal with context layers. | |
Uses key to identify the hidden layer associated with each layer in the self.contextLayers dictionary. | |
This exists so that other extensions can interface at the point where the call is made to Network.step(). | |
Sets prediction between an input and output layer. | |
SRN.propagate: Sets error flags and propagates. | |
Clears the context layer by setting context layer to (default) value 0.5. | |
Clear context layer between sequences. | |
Set self.learnDuringSequence. | |
You must set this! Set it to "epoch" or "pattern". | |
SRN.step() Extends network step method by automatically copying hidden layer activations to the context layer. | |
sweepCrossValidation() will go through each of the crossvalidation input/targets. | |
| Inherited from Network | |
Returns the layer specified by name. | |
Returns the number of layers in the network. | |
Returns string representation of network. | |
Determine the activation of a node based on that nodes net input. | |
Used in compute_error. | |
Adds a layer. | |
| |
Adds a pattern with key word. | |
Returns an array of node bias values and connection weights for use in a GA. | |
inName layer and outName layer will be auto-associating. | |
Initializes error computation. | |
Changes the weights according to the error values calculated during backprop(). | |
Changes layer size. | |
Close the layerName's log file. | |
Compares two values. | |
Computes error for all non-output layers backwards through all projections. | |
Computes weight error derivative for all connections in self.connections starting with the last connection. | |
Connects two layers by instantiating an instance of Connection class. | |
Copies activations in vec to the specified layer, replacing patterns if necessary. | |
Copies targets in vec to specified layer, replacing patterns if necessary. | |
Copies vec2 into vector1 being sure to replace patterns if necessary. | |
Alternate to sweep(). | |
Delete a pattern with key word. | |
Returns value to within 0.001. | |
Displays the network to the screen. | |
Returns a dictionary of layer names that map to a list of activations. | |
Returns the value of the active flag for the layer specified by layerName. | |
Returns the connection instance connecting the specified (string) layer names. | |
Returns the number of correct activation within tolerance of a layer. | |
Returns dictionary with input and target given pos. | |
| |
Returns the epsilon for the Network instance. | |
| |
Returns the layer with the argument (string) name. | |
Given a reference to a layer, returns the index of that layer in self.layers. | |
Returns the pattern with key word. | |
Gets the weights of the connection between two layers (argument strings). | |
Returns the word associated with pattern. | |
Initializes network by calling Connection.initialize() and Layer.initialize(). | |
| |
Loads data (targets/inputs) from file. | |
Loads inputs as patterns from file. | |
Loads inputs from file. | |
Loads targets as patterns from file. | |
Loads targets from file. | |
Load a set of vectors from a file. | |
Loads weights from a file in pickle, plain, or tlearn mode. | |
Sets the layerName's log feature. | |
Logs a message with layerName log. | |
Adds layerName and offset to inputMap. | |
| |
Adds layerName and offset to targetMap. | |
| |
Used in error checking with verifyArchitecture() and in prop_from(). | |
Replaces vector with patterns. | |
| |
| |
| |
| |
| |
| |
Start propagation from the layers in the list startLayers. | |
Propagates activation through the network. | |
Puts a dict of name: activations into their respective layers. | |
Randomizes self.loadOrder, the order in which inputs set with self.setInputs() are presented. | |
Replaces patterned inputs or targets with activation vectors. | |
| |
| |
| |
| |
Resets seed values. | |
Resets layer flags for activation and target. | |
Returns Root Mean Squared Error for all output layers in this network. | |
Saves data (targets/inputs) to file. | |
Saves inputs to file. | |
| |
Saves network to file using pickle. | |
Saves targets to file. | |
Saves weights to file in pickle, plain, or tlearn mode. | |
Sets a layer to active. | |
| |
| |
Sets self.batch to value. | |
Sets epsilon value for the network. | |
Sets self.input to inputs. | |
Network.setInputsAndTargets() Sets the corpus of data for training. | |
Sets interactive to value. | |
| |
Sets learning to value. | |
Sets the maxRandom Layer attribute for each layer to value.Specifies the global range for randomly initialized values, [-max, max]. | |
Sets self.momentum to value. | |
Sets self.orderedInputs to value. | |
For compatiblity. | |
Sets a pattern with key word. | |
Sets the network to use patterns for inputs and targets. | |
Sets patterns to the dictionary argument. | |
Sets self.reportRate to value. | |
Sets self.resetEpoch to value. | |
Sets self.resetLimit to value. | |
Sets the seed to value. | |
Sets self.sigmoid_prime_offset to value. | |
Sets self.stopPercent to value. | |
Sets self.sweepReportRate to value. | |
Sets the targets. | |
Sets tolerance to value. | |
| |
Sets flag so that self.stopPercent is compared to cross validation percent rather than the regular training data percentage correct. | |
Sets self.verbosity and each layer verbosity to value. | |
Sets the weight of the connection between two layers (argument strings). | |
Share weights with another network. | |
Runs through entire dataset. | |
Returns the network layers as a string. | |
Trains the network on the dataset till a stopping condition is met. | |
Returns Total Sum Squared error for the specified layer's pattern. | |
Copies gene bias values and weights to network bias values and weights. | |
Check for orphaned layers or connections. | |
Verifies that arguments to setInputs and setTargets are appropriately formatted. | |
Used in propagate() to verify that the network input activations have been set. | |
Used in backprop() to verify that the network targets have been set. | |
| Method Details |
|---|
__init__(self,
name='Simple Recurrent Network',
verbosity=0)
|
addContext(self, layer, hiddenLayerName='hidden', verbosity=0)Adds a context layer. Necessary to keep self.contextLayers dictionary up to date. |
addSRNLayers(self, inc, hidc, outc)Wraps SRN.addThreeLayers() for compatibility. |
addThreeLayers(self, inc, hidc, outc)Creates a three level network with a context layer.
|
backprop(self)Extends backprop() from Network to automatically deal with context layers. Copies the contexts, if contextCopying is true.
|
copyHiddenToContext(self)Uses key to identify the hidden layer associated with each layer in the self.contextLayers dictionary. |
networkStep(self, **args)This exists so that other extensions can interface at the point where the call is made to Network.step(). See governor.py for an example. |
predict(self, inName, outName)Sets prediction between an input and output layer. |
propagate(self, **args)SRN.propagate: Sets error flags and propagates.
|
setContext(self, value=0.5)Clears the context layer by setting context layer to (default) value 0.5. |
setInitContext(self, value)Clear context layer between sequences. |
setLearnDuringSequence(self, value)Set self.learnDuringSequence. |
setSequenceType(self, value)You must set this! Set it to "epoch" or "pattern". |
step(self, **args)SRN.step() Extends network step method by automatically copying hidden layer activations to the context layer.
|
sweepCrossValidation(self)
sweepCrossValidation() will go through each of the crossvalidation input/targets.
The crossValidationCorpus is a list of dictionaries of input/targets
referenced by layername.
Example: ({"input": [0.0, 0.1], "output": [1.0]}, {"input": [0.5, 0.9], "output": [0.0]})
|
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Mon Jul 25 01:39:27 2005 | http://epydoc.sf.net |