Class ANN_Network

Description
  • access: public

Located in /Network.php (line 51)

ANN_Filesystem
   |
   --ANN_Network
Class Constant Summary
Method Summary
[662]   protected   static   string :  getDefaultFilename ()
[1025]   public   static   void :  loadFromFile ([string $strFilename = null])
[1297]   public   static   ANN_Network :  loadFromHost (string $strUsername, string $strPassword, string $strHost)
[118]   public   ANN_Network :  __construct ([integer $intNumberOfHiddenLayers = 1], [integer $intNumberOfNeuronsPerLayer = 6], [integer $intNumberOfOutputs = 1])
[352]   protected   void :  activate ()
[982]   protected   void :  calculateMaxTrainingLoops ()
[312]   protected   void :  createHiddenLayers (integer $intNumberOfHiddenLayers, integer $intNumberOfNeuronsPerLayer)
[339]   protected   void :  createOutputLayer (integer $intNumberOfOutputs)
[1329]   protected   void :  detectOutputType ()
[618]   protected   integer :  getCountInputs ()
[1209]   protected   float :  getNetworkError ()
[452]   protected   integer :  getNextIndexInputsToTrain ([boolean $boolReset = FALSE])
[1070]   public   integer :  getNumberHiddenLayers ()
[1084]   public   integer :  getNumberHiddens ()
[1055]   public   integer :  getNumberInputs ()
[1099]   public   integer :  getNumberOutputs ()
[250]   public   array :  getOutputs ()
[288]   public   array :  getOutputsByInputKey (integer $intKeyInput)
[481]   public   integer :  getTotalLoops ()
[492]   protected   boolean :  isEpoch ()
[536]   protected   boolean :  isTrainingComplete ()
[568]   protected   boolean :  isTrainingCompleteByEpoch ()
[585]   protected   boolean :  isTrainingCompleteByInputKey (integer $intKeyInput)
[1191]   protected   void :  logNetworkErrors ()
[1136]   public   void :  logNetworkErrorsToFile (string $strFilename)
[1154]   protected   void :  logWeights ()
[1117]   public   void :  logWeightsToFile (string $strFilename)
[704]   public   void :  printNetwork ([integer $intLevel = 2])
[782]   protected   void :  printNetworkDetails1 ()
[891]   protected   void :  printNetworkDetails2 ()
[1041]   public   void :  saveToFile ([string $strFilename = null])
[1267]   public   void :  saveToHost (string $strUsername, string $strPassword, string $strHost)
[148]   protected   void :  setInputs (array $arrInputs)
[227]   protected   void :  setInputsToTrain (array $arrInputs)
[518]   public   void :  setLearningRate ([float $floatLearningRate = 0.7])
[996]   public   void :  setMaxTrainingLoopsFactor ([integer $intMaxTrainingLoopsFactor = 230])
[1351]   public   void :  setOutputErrorTolerance ([float $floatOutputErrorTolerance = 0.02])
[172]   protected   void :  setOutputs (array $arrOutputs)
[675]   protected   void :  setOutputType ([integer $intType = self::OUTPUT_LINEAR])
[213]   public   void :  setValues (ANN_Values $objValues)
[385]   public   boolean :  train ()
[1232]   public   ANN_Network :  trainByHost (string $strUsername, string $strPassword, string $strHost)
[637]   protected   void :  training (array $arrOutputs)
[1010]   public   void :  __wakeup ()
Methods
protected static string getDefaultFilename () [662]
  • return: Filename
  • access: protected
public static void loadFromFile ([string $strFilename = null]) [1025]
  • string $strFilename: (Default: null)

Redefinition of:
ANN_Filesystem::loadFromFile()
public static ANN_Network loadFromHost (string $strUsername, string $strPassword, string $strHost) [1297]
  • throws: ANN_Exception
  • access: public
  • string $strUsername
  • string $strPassword
  • string $strHost
public  ANN_Network __construct ([integer $intNumberOfHiddenLayers = 1], [integer $intNumberOfNeuronsPerLayer = 6], [integer $intNumberOfOutputs = 1]) [118]
  • integer $intNumberOfHiddenLayers: (Default: 1)
  • integer $intNumberOfNeuronsPerLayer: (Default: 6)
  • integer $intNumberOfOutputs: (Default: 1)
protected  void activate () [352]
protected  void calculateMaxTrainingLoops () [982]
protected  void createHiddenLayers (integer $intNumberOfHiddenLayers, integer $intNumberOfNeuronsPerLayer) [312]
  • integer $intNumberOfHiddenLayers
  • integer $intNumberOfNeuronsPerLayer
protected  void createOutputLayer (integer $intNumberOfOutputs) [339]
  • integer $intNumberOfOutputs
protected  void detectOutputType () [1329]
protected  integer getCountInputs () [618]
protected  float getNetworkError () [1209]
protected  integer getNextIndexInputsToTrain ([boolean $boolReset = FALSE]) [452]
  • boolean $boolReset: (Default: FALSE)
public  integer getNumberHiddenLayers () [1070]
public  integer getNumberHiddens () [1084]
public  integer getNumberInputs () [1055]
public  integer getNumberOutputs () [1099]
public  array getOutputs () [250]

Get the output values

Get the output values to the related input values set by setValues(). This method returns the output values as a two-dimensional array.

public  array getOutputsByInputKey (integer $intKeyInput) [288]
  • integer $intKeyInput
public  integer getTotalLoops () [481]
  • access: public
protected  boolean isEpoch () [492]
protected  boolean isTrainingComplete () [536]
protected  boolean isTrainingCompleteByEpoch () [568]
protected  boolean isTrainingCompleteByInputKey (integer $intKeyInput) [585]
  • integer $intKeyInput
protected  void logNetworkErrors () [1191]
public  void logNetworkErrorsToFile (string $strFilename) [1136]

Log network errors while training in CSV format

  • string $strFilename
protected  void logWeights () [1154]
public  void logWeightsToFile (string $strFilename) [1117]

Log weights while training in CSV format

  • string $strFilename
public  void printNetwork ([integer $intLevel = 2]) [704]
  • integer $intLevel: (0, 1, 2) (Default: 2)
protected  void printNetworkDetails1 () [782]
protected  void printNetworkDetails2 () [891]
public  void saveToFile ([string $strFilename = null]) [1041]
  • string $strFilename: (Default: null)

Redefinition of:
ANN_Filesystem::saveToFile()
public  void saveToHost (string $strUsername, string $strPassword, string $strHost) [1267]
  • throws: ANN_Exception
  • access: public
  • string $strUsername
  • string $strPassword
  • string $strHost
protected  void setInputs (array $arrInputs) [148]
  • array $arrInputs
protected  void setInputsToTrain (array $arrInputs) [227]
  • array $arrInputs
public  void setLearningRate ([float $floatLearningRate = 0.7]) [518]

Setting the learning rate

  • throws: ANN_Exception
  • access: public
  • uses: ANN_Exception::__construct()
  • float $floatLearningRate: (Default: 0.7) (0.1 .. 0.9)
public  void setMaxTrainingLoopsFactor ([integer $intMaxTrainingLoopsFactor = 230]) [996]
  • throws: ANN_Exception
  • access: public
  • integer $intMaxTrainingLoopsFactor: (Default: 230)
public  void setOutputErrorTolerance ([float $floatOutputErrorTolerance = 0.02]) [1351]

Setting the percentage of output error in comparison to the desired output

  • access: public
  • float $floatOutputErrorTolerance: (Default: 0.02)
protected  void setOutputs (array $arrOutputs) [172]
  • array $arrOutputs
protected  void setOutputType ([integer $intType = self::OUTPUT_LINEAR]) [675]
  • integer $intType: (Default: ANN_Network::OUTPUT_LINEAR)
public  void setValues (ANN_Values $objValues) [213]

Set Values for training or using network

Set Values of inputs and outputs for training or just inputs for using already trained network.

  1.  $objNetwork new ANN_Network(241);
  2.  
  3.  $objValues new ANN_Values;
  4.  
  5.  $objValues->train()
  6.            ->input(0.120.110.15)
  7.            ->output(0.56);
  8.  
  9.  $objNetwork->setValues($objValues);

public  ANN_Network trainByHost (string $strUsername, string $strPassword, string $strHost) [1232]
  • throws: ANN_Exception
  • access: public
  • string $strUsername
  • string $strPassword
  • string $strHost
protected  void training (array $arrOutputs) [637]
  • array $arrOutputs
public  void __wakeup () [1010]

Inherited Methods

Inherited From ANN_Filesystem

ANN_Filesystem::loadFromFile()
ANN_Filesystem::saveToFile()
Class Constants
OUTPUT_BINARY = 2 (line 103)

Binary output type

OUTPUT_LINEAR = 1 (line 97)

Linear output type

Documentation generated on Sat, 26 Dec 2009 15:41:31 +0100 by phpDocumentor 1.4.1