Package pyrobot :: Package brain :: Module governor :: Class GovernorNetwork
[frames | no frames]

Class GovernorNetwork

Governor --+
           |
 Network --+
           |
          GovernorNetwork


Method Summary
  __init__(self, bufferSize, epsilon, delta, historySize, alpha, mask, verbosity)
  addThreeLayers(self, i, h, o)
  networkStep(self, **args)
  setLearning(self, value)
Sets learning to value.
  setVerbosity(self, val)
    Inherited from Governor
  __nextitem__(self)
For use in iterable positions: >>> govnet = GovernorNetwork() >>> for item in govnet: ...
  distancesTo(self, vector)
Computes euclidean distance from a vector to all model vectors.
  incompatibility(self)
For each model, how different is it from each of the buffer items? Returns list of incompatibilities.
  input(self, vector)
Wrapper around ravq.input() which returns index and mapped-to m.v.
  loadRAVQ(self, filename)
Loads RAVQ data from a file.
  map(self, vector)
Returns the index and vector of winning position.
  nextItem(self)
Public interface for getting next item from RAVQ.
  saveRAVQ(self, filename)
Saves RAVQ data to a file.
  setBalancedMask(self)
Give each layer an equal weighting, so that all weights sum to one.
  setMask(self, **args)
Takes a dictionary of layer names and mask weights.
  winner(self)
Get's winning name, m.v.
    Inherited from Network
  __getitem__(self, name)
Returns the layer specified by name.
  __len__(self)
Returns the number of layers in the network.
  __str__(self)
Returns string representation of network.
  activationFunction(self, x)
Determine the activation of a node based on that nodes net input.
  ACTPRIME(self, act)
Used in compute_error.
  add(self, layer, verbosity)
Adds a layer.
  addLayer(self, name, size, verbosity)
  addPattern(self, word, vector)
Adds a pattern with key word.
  arrayify(self)
Returns an array of node bias values and connection weights for use in a GA.
  associate(self, inName, outName)
inName layer and outName layer will be auto-associating.
  backprop(self)
Computes error and wed for back propagation of error.
  ce_init(self)
Initializes error computation.
  change_weights(self)
Changes the weights according to the error values calculated during backprop().
  changeLayerSize(self, layername, newsize)
Changes layer size.
  closeLog(self, layerName)
Close the layerName's log file.
  compare(self, v1, v2)
Compares two values.
  compute_error(self)
Computes error for all non-output layers backwards through all projections.
  compute_wed(self)
Computes weight error derivative for all connections in self.connections starting with the last connection.
  connect(self, fromName, toName)
Connects two layers by instantiating an instance of Connection class.
  copyActivations(self, layer, vec, start)
Copies activations in vec to the specified layer, replacing patterns if necessary.
  copyTargets(self, layer, vec, start)
Copies targets in vec to specified layer, replacing patterns if necessary.
  copyVector(self, vector1, vec2, start)
Copies vec2 into vector1 being sure to replace patterns if necessary.
  cycle(self)
Alternate to sweep().
  delPattern(self, word)
Delete a pattern with key word.
  diff(self, value)
Returns value to within 0.001.
  display(self)
Displays the network to the screen.
  getActivationsDict(self, nameList)
Returns a dictionary of layer names that map to a list of activations.
  getActive(self, layerName)
Returns the value of the active flag for the layer specified by layerName.
  getConnection(self, lfrom, lto)
Returns the connection instance connecting the specified (string) layer names.
  getCorrect(self, layerName)
Returns the number of correct activation within tolerance of a layer.
  getData(self, pos)
Returns dictionary with input and target given pos.
  getDataCrossValidation(self, pos)
  getEpsilon(self)
Returns the epsilon for the Network instance.
  getError(self, *layerNames)
  getLayer(self, name)
Returns the layer with the argument (string) name.
  getLayerIndex(self, layer)
Given a reference to a layer, returns the index of that layer in self.layers.
  getPattern(self, word)
Returns the pattern with key word.
  getWeights(self, fromName, toName)
Gets the weights of the connection between two layers (argument strings).
  getWord(self, pattern)
Returns the word associated with pattern.
  initialize(self)
Initializes network by calling Connection.initialize() and Layer.initialize().
  loadCrossValidation(self, filename)
  loadDataFromFile(self, filename, ocnt)
Loads data (targets/inputs) from file.
  loadInputPatternsFromFile(self, filename, cols, everyNrows, delim, checkEven)
Loads inputs as patterns from file.
  loadInputsFromFile(self, filename, cols, everyNrows, delim, checkEven)
Loads inputs from file.
  loadTargetPatternssFromFile(self, filename, cols, everyNrows, delim, checkEven)
Loads targets as patterns from file.
  loadTargetsFromFile(self, filename, cols, everyNrows, delim, checkEven)
Loads targets from file.
  loadVectorsFromFile(self, filename, cols, everyNrows, delim, checkEven, patterned)
Load a set of vectors from a file.
  loadWeightsFromFile(self, filename, mode)
Loads weights from a file in pickle, plain, or tlearn mode.
  logLayer(self, layerName, fileName)
Sets the layerName's log feature.
  logMsg(self, layerName, message)
Logs a message with layerName log.
  mapInput(self, layerName, offset)
Adds layerName and offset to inputMap.
  mapInputs(self, nameOffsetPairs)
  mapTarget(self, layerName, offset)
Adds layerName and offset to targetMap.
  mapTargets(self, nameOffsetPairs)
  path(self, startLayer, endLayer)
Used in error checking with verifyArchitecture() and in prop_from().
  patternVector(self, vector)
Replaces vector with patterns.
  postStep(self)
  postSweep(self)
  preStep(self)
  preSweep(self)
  Print(self, msg)
  prompt(self)
  prop_from(self, startLayers)
Start propagation from the layers in the list startLayers.
  propagate(self, **args)
Propagates activation through the network.
  propagateFrom(self, startLayer, **args)
Propagates activation through the network.
  putActivations(self, dict)
Puts a dict of name: activations into their respective layers.
  randomizeOrder(self)
Randomizes self.loadOrder, the order in which inputs set with self.setInputs() are presented.
  replacePatterns(self, vector)
Replaces patterned inputs or targets with activation vectors.
  reportEpoch(self, epoch, tssErr, totalCorrect, totalCount, rmsErr)
  reportFinal(self, epoch, tssErr, totalCorrect, totalCount, rmsErr)
  reportPattern(self)
  reportStart(self)
  reset(self)
Resets seed values.
  resetFlags(self)
Resets layer flags for activation and target.
  RMSError(self)
Returns Root Mean Squared Error for all output layers in this network.
  saveDataToFile(self, filename)
Saves data (targets/inputs) to file.
  saveInputsToFile(self, filename)
Saves inputs to file.
  saveNetworkForCrossValidation(self, filename, mode)
  saveNetworkToFile(self, filename, makeWrapper)
Saves network to file using pickle.
  saveTargetsToFile(self, filename)
Saves targets to file.
  saveWeightsToFile(self, filename, mode)
Saves weights to file in pickle, plain, or tlearn mode.
  setActive(self, layerName, value)
Sets a layer to active.
  setAutoCrossValidation(self, value)
  setAutoSaveWeightsFile(self, filename)
  setBatch(self, value)
Sets self.batch to value.
  setEpsilon(self, value)
Sets epsilon value for the network.
  setInputs(self, inputs)
Sets self.input to inputs.
  setInputsAndTargets(self, data1, data2)
Network.setInputsAndTargets() Sets the corpus of data for training.
  setInteractive(self, value)
Sets interactive to value.
  setLayerVerification(self, value)
  setMaxRandom(self, value)
Sets the maxRandom Layer attribute for each layer to value.Specifies the global range for randomly initialized values, [-max, max].
  setMomentum(self, value)
Sets self.momentum to value.
  setOrderedInputs(self, value)
Sets self.orderedInputs to value.
  setOutputs(self, outputs)
For compatiblity.
  setPattern(self, word, vector)
Sets a pattern with key word.
  setPatterned(self, value)
Sets the network to use patterns for inputs and targets.
  setPatterns(self, patterns)
Sets patterns to the dictionary argument.
  setReportRate(self, value)
Sets self.reportRate to value.
  setResetEpoch(self, value)
Sets self.resetEpoch to value.
  setResetLimit(self, value)
Sets self.resetLimit to value.
  setSeed(self, value)
Sets the seed to value.
  setSigmoid_prime_offset(self, value)
Sets self.sigmoid_prime_offset to value.
  setStopPercent(self, value)
Sets self.stopPercent to value.
  setSweepReportRate(self, value)
Sets self.sweepReportRate to value.
  setTargets(self, targets)
Sets the targets.
  setTolerance(self, value)
Sets tolerance to value.
  setup(self)
  setUseCrossValidationToStop(self, value)
Sets flag so that self.stopPercent is compared to cross validation percent rather than the regular training data percentage correct.
  setWeight(self, fromName, fromPos, toName, toPos, value)
Sets the weight of the connection between two layers (argument strings).
  shareWeights(self, network, listOfLayerNamePairs)
Share weights with another network.
  step(self, **args)
Network.step() Does a single step.
  sweep(self)
Runs through entire dataset.
  sweepCrossValidation(self)
sweepCrossValidation() will go through each of the crossvalidation input/targets.
  toString(self)
Returns the network layers as a string.
  train(self, cont)
Trains the network on the dataset till a stopping condition is met.
  TSSError(self, layerName)
Returns Total Sum Squared error for the specified layer's pattern.
  unArrayify(self, gene)
Copies gene bias values and weights to network bias values and weights.
  verifyArchitecture(self)
Check for orphaned layers or connections.
  verifyArguments(self, arg)
Verifies that arguments to setInputs and setTargets are appropriately formatted.
  verifyInputs(self)
Used in propagate() to verify that the network input activations have been set.
  verifyTargets(self)
Used in backprop() to verify that the network targets have been set.

Method Details

setLearning(self, value)

Sets learning to value. Determines if the network learns,
ie. changes connection weights.
Overrides:
pyrobot.brain.conx.Network.setLearning (inherited documentation)

Generated by Epydoc 2.1 on Mon Jul 25 01:39:28 2005 http://epydoc.sf.net