package ANN
access public

 Methods

__construct()

__construct(integer $intNumberOfHiddenLayers, integer $intNumberOfNeuronsPerLayer, integer $intNumberOfOutputs) 
uses \ANN\Exception::__construct()
uses \ANN\setMaxExecutionTime()
uses \ANN\createHiddenLayers()
uses \ANN\createOutputLayer()

Parameters

$intNumberOfHiddenLayers

integer

(Default: 1)

$intNumberOfNeuronsPerLayer

integer

(Default: 6)

$intNumberOfOutputs

integer

(Default: 1)

Exceptions

\ANN\Exception

__invoke()

__invoke(integer $intLevel) 
uses \ANN\printNetwork()

Parameters

$intLevel

integer

(Default: 2)

__toString()

__toString() : string
uses \ANN\getPrintNetwork()

Returns

string

__wakeup()

__wakeup() 
uses \ANN\setMaxExecutionTime()

getNetworkInfo()

getNetworkInfo() : array
uses \ANN\getCPULimit()
uses \ANN\getMaxExecutionTime()
uses \ANN\getNetworkError()
uses \ANN\getNumberInputs()
uses \ANN\getTrainedInputsPercentage()
used_by \ANN\Controller\ControllerPrintNetwork::Content()
used_by \ANN\Controller\ControllerPrintNetwork::getNeurons()

Returns

array

getNumberHiddenLayers()

getNumberHiddenLayers() : integer
used_by \ANN\NetworkGraph::__construct()

Returns

integer

getNumberHiddens()

getNumberHiddens() : integer
used_by \ANN\NetworkGraph::__construct()

Returns

integer

getNumberInputs()

getNumberInputs() : integer
used_by \ANN\NetworkGraph::__construct()

Returns

integer

getNumberOutputs()

getNumberOutputs() : integer
used_by \ANN\NetworkGraph::__construct()

Returns

integer

Get the output values

getOutputs() : array

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

uses \ANN\activate()
uses \ANN\getCountInputs()
uses \ANN\Layer::getOutputs()
uses \ANN\Layer::getThresholdOutputs()
uses \ANN\setInputsToTrain()

Returns

arraytwo-dimensional array

getOutputsByInputKey()

getOutputsByInputKey(integer $intKeyInput) : array
uses \ANN\activate()
uses \ANN\Layer::getOutputs()
uses \ANN\Layer::getThresholdOutputs()
uses \ANN\setInputsToTrain()

Parameters

$intKeyInput

integer

Returns

array

getTotalLoops()

getTotalLoops() : integer

Returns

integer

loadFromFile()

loadFromFile(string $strFilename) : \ANN\Network
Static
uses \ANN\parent::loadFromFile()
uses \ANN\getDefaultFilename()
used_by \ANN\Server::loadFromHost()

Parameters

$strFilename

string

(Default: null)

Exceptions

\ANN\Exception

Returns

loadFromHost()

loadFromHost(string $strUsername, string $strPassword, string $strHost) : \ANN\Network
Static

Parameters

$strUsername

string

$strPassword

string

$strHost

string

Exceptions

\ANN\Exception

Returns

Log network errors while training in CSV format

logNetworkErrorsToFile(string $strFilename) 
uses \ANN\Logging::__construct()
uses \ANN\Logging::setFilename()

Parameters

$strFilename

string

Log weights while training in CSV format

logWeightsToFile(string $strFilename) 
uses \ANN\Logging::__construct()
uses \ANN\Logging::setFilename()

Parameters

$strFilename

string

printNetwork()

printNetwork() 
uses \ANN\Controller\ControllerPrintNetwork::__construct()

saveToFile()

saveToFile(string $strFilename) 
uses \ANN\parent::saveToFile()
uses \ANN\getDefaultFilename()
used_by \ANN\Server::saveToHost()
used_by \ANN\Server::trainByHost()

Parameters

$strFilename

string

(Default: null)

Exceptions

\ANN\Exception

saveToHost()

saveToHost(string $strUsername, string $strPassword, string $strHost) 

Parameters

$strUsername

string

$strPassword

string

$strHost

string

Exceptions

\ANN\Exception

setMomentum()

setMomentum(float $floatMomentum) 
uses \ANN\Exception::__construct()

Parameters

$floatMomentum

float

(Default: 0.95) (0 .. 1)

Exceptions

\ANN\Exception

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

setOutputErrorTolerance(float $floatOutputErrorTolerance) 

Parameters

$floatOutputErrorTolerance

float

(Default: 0.02)

Set Values for training or using network

setValues(\ANN\Values $objValues) 

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

$objNetwork = new \ANN\Network(2, 4, 1);

$objValues = new \ANN\Values;

$objValues->train()
          ->input(0.12, 0.11, 0.15)
          ->output(0.56);

$objNetwork->setValues($objValues);
uses \ANN\Values::getInputsArray()
uses \ANN\Values::getOutputsArray()
uses \ANN\setInputs()
uses \ANN\setOutputs()
since 2.0.6

Parameters

$objValues

\ANN\Values

train()

train() : boolean
uses \ANN\Exception::__construct()
uses \ANN\setInputs()
uses \ANN\setOutputs()
uses \ANN\hasTimeLeftForTraining()
uses \ANN\isTrainingComplete()
uses \ANN\isTrainingCompleteByEpoch()
uses \ANN\setInputsToTrain()
uses \ANN\training()
uses \ANN\isEpoch()
uses \ANN\logWeights()
uses \ANN\logNetworkErrors()
uses \ANN\getNextIndexInputsToTrain()
uses \ANN\isTrainingCompleteByInputKey()
uses \ANN\setDynamicLearningRate()
uses \ANN\detectOutputType()
used_by \ANN\Server::trainByHost()

Exceptions

\ANN\Exception

Returns

boolean

trainByHost()

trainByHost(string $strUsername, string $strPassword, string $strHost) : \ANN\Network

Parameters

$strUsername

string

$strPassword

string

$strHost

string

Exceptions

\ANN\Exception

Returns

activate()

activate() 
uses \ANN\Layer::setInputs()
uses \ANN\Layer::activate()
uses \ANN\Layer::getOutputs()

createHiddenLayers()

createHiddenLayers(integer $intNumberOfHiddenLayers, integer $intNumberOfNeuronsPerLayer) 
uses \ANN\Layer::__construct()

Parameters

$intNumberOfHiddenLayers

integer

$intNumberOfNeuronsPerLayer

integer

createOutputLayer()

createOutputLayer(integer $intNumberOfOutputs) 
uses \ANN\Layer::__construct()

Parameters

$intNumberOfOutputs

integer

detectOutputType()

detectOutputType() 
uses \ANN\setOutputType()

getCPULimit()

getCPULimit() : integer

Returns

integerSeconds

getCountInputs()

getCountInputs() : integer

Returns

integer

getDefaultFilename()

getDefaultFilename() : string
Static

Returns

stringFilename

getMaxExecutionTime()

getMaxExecutionTime() : integer

Returns

integerSeconds

getNetworkError()

getNetworkError() : float
uses \ANN\getOutputs()

Returns

float

getNextIndexInputsToTrain()

getNextIndexInputsToTrain(boolean $boolReset) : integer

Parameters

$boolReset

boolean

(Default: FALSE)

Returns

integer

getTrainedInputsPercentage()

getTrainedInputsPercentage() : float
uses \ANN\isTrainingCompleteByInputKey()

Returns

float

hasTimeLeftForTraining()

hasTimeLeftForTraining() : boolean

Returns

boolean

isEpoch()

isEpoch() : boolean

Returns

boolean

isTrainingComplete()

isTrainingComplete() : boolean
uses \ANN\getOutputs()

Returns

boolean

isTrainingCompleteByEpoch()

isTrainingCompleteByEpoch() : boolean

Returns

boolean

isTrainingCompleteByInputKey()

isTrainingCompleteByInputKey(integer $intKeyInput) : boolean
uses \ANN\getOutputsByInputKey()

Parameters

$intKeyInput

integer

Returns

boolean

logNetworkErrors()

logNetworkErrors() 
uses \ANN\getNetworkError()
uses \ANN\Logging::logData()

logWeights()

logWeights() 
uses \ANN\Layer::getNeurons()
uses \ANN\Logging::logData()
uses \ANN\Neuron::getWeights()
uses \ANN\getNetworkError()

Dynamic Learning Rate

setDynamicLearningRate(integer $intLoop) 

Setting learning rate all 1000 loops dynamically

uses \ANN\setLearningRate()

Parameters

$intLoop

integer

setInputs()

setInputs(array $arrInputs) 

Parameters

$arrInputs

array

setInputsToTrain()

setInputsToTrain(array $arrInputs) 
uses \ANN\Layer::setInputs()

Parameters

$arrInputs

array

Setting the learning rate

setLearningRate(float $floatLearningRate) 
uses \ANN\Exception::__construct()

Parameters

$floatLearningRate

float

(Default: 0.7) (0.1 .. 0.9)

Exceptions

\ANN\Exception

setMaxExecutionTime()

setMaxExecutionTime() 
uses \ANN\getCPULimit()
uses \ANN\getMaxExecutionTime()

Exceptions

\ANN\Exception

setOutputType()

setOutputType(integer $intType) 
uses \ANN\Exception::__construct()

Parameters

$intType

integer

(Default: Network::OUTPUT_LINEAR)

Exceptions

\ANN\Exception

setOutputs()

setOutputs(array $arrOutputs) 
uses \ANN\Exception::__construct()
uses \ANN\Layer::getNeuronsCount()

Parameters

$arrOutputs

array

Exceptions

\ANN\Exception

training()

training(array $arrOutputs) 
uses \ANN\activate()
uses \ANN\Layer::calculateHiddenDeltas()
uses \ANN\Layer::adjustWeights()
uses \ANN\Layer::calculateOutputDeltas()
uses \ANN\getNetworkError()

Parameters

$arrOutputs

array

 Properties

 

$boolFirstEpochOfTraining : boolean
 

$boolFirstLoopOfTraining : boolean
 

$floatLearningRate : float
 

$floatMomentum : float
 

$intOutputType : integer
 

$arrHiddenLayers : array
 

$arrInputs : array
 

$arrOutputs : array
 

$arrTrainingComplete : array
 

$boolLoggingNetworkErrors : boolean
 

$boolLoggingWeights : boolean
 

$boolNetworkActivated : boolean
 

$boolTrained : boolean
 

$floatOutputErrorTolerance : float
 

$intMaxExecutionTime : integer
 

$intNumberEpoch : integer
 

$intNumberOfHiddenLayers : integer
 

$intNumberOfHiddenLayersDec : integer
 

$intNumberOfNeuronsPerLayer : integer
 

$intTotalActivations : integer
 

$intTotalActivationsRequests : integer
 

$intTotalLoops : integer
 

$intTotalTrainings : integer
 

$intTrainingTime : integer
 

$objLoggingNetworkErrors : \ANN\Logging
 

$objLoggingWeights : \ANN\Logging
 

$objOutputLayer : \ANN\Layer
 

$arrInputsToTrain : array
 

$intInputsToTrainIndex : integer

 Constants

 

Binary output type

OUTPUT_BINARY 
 

Linear output type

OUTPUT_LINEAR