CEL

Public API Reference

iPcNeuralNet Struct Reference

A property class implementing a feed-forward neural network. More...

#include <propclass/neuralnet.h>

Inheritance diagram for iPcNeuralNet:

List of all members.

Public Member Functions

virtual bool CacheWeights (const char *scope, uint32 id) const =0
 Saves the weightings to cache with an iCacheManager.
virtual csPtr< iCelNNWeightsCreateEmptyWeights () const =0
 Returns a new weights structure with the same size as the current one.
virtual const celDataGetOutput (size_t index) const =0
 Returns the value of one of the outputs.
virtual const csArray< celData > & GetOutputs () const =0
 Retrieves all the output values in one go.
virtual void GetWeights (iCelNNWeights *out) const =0
 Copies the weightings of the neural network into the structure provided.
virtual bool LoadCachedWeights (const char *scope, uint32 id)=0
 Loads the weightings from cache with an iCacheManager.
virtual void Process ()=0
 Runs one iteration through the network, reading the inputs and setting the outputs.
virtual void SetActivationFunc (celNNActivationFunc *)=0
 Sets the activation function of the neural network.
virtual void SetComplexity (const char *name)=0
 Sets the heuristic that will be used to set the sizes of each layer.
virtual void SetInput (size_t index, const celData &value)=0
 Sets the value of one of the inputs.
virtual void SetInputs (const csArray< celData > &values)=0
 Sets all the input values in one go.
virtual void SetLayerSizes (const csArray< size_t > &sizes)=0
 Manually set the number of nodes in each hidden layer.
virtual void SetSize (size_t inputs, size_t outputs, size_t layers)=0
 Sets the size of the neural network (number of inputs, outputs and hidden layers).
virtual bool SetWeights (const iCelNNWeights *in)=0
 Copies the weightings into the neural network from the given structure.
virtual bool Validate ()=0
 Returns true if the neural network is initialized and ready to use.


Detailed Description

A property class implementing a feed-forward neural network.

The property class holds the following properties (add prefix "cel.property." to get a property ID):

And the following actions (add prefix "cel.action." or "cel.parameter." to get the ID of an action or parameter respectively):

And can send the following message to the behaviour:

Definition at line 96 of file neuralnet.h.


Member Function Documentation

virtual bool iPcNeuralNet::CacheWeights ( const char *  scope,
uint32  id 
) const [pure virtual]

Saves the weightings to cache with an iCacheManager.

virtual csPtr<iCelNNWeights> iPcNeuralNet::CreateEmptyWeights (  )  const [pure virtual]

Returns a new weights structure with the same size as the current one.

virtual const celData& iPcNeuralNet::GetOutput ( size_t  index  )  const [pure virtual]

Returns the value of one of the outputs.

virtual const csArray<celData>& iPcNeuralNet::GetOutputs (  )  const [pure virtual]

Retrieves all the output values in one go.

virtual void iPcNeuralNet::GetWeights ( iCelNNWeights out  )  const [pure virtual]

Copies the weightings of the neural network into the structure provided.

virtual bool iPcNeuralNet::LoadCachedWeights ( const char *  scope,
uint32  id 
) [pure virtual]

Loads the weightings from cache with an iCacheManager.

virtual void iPcNeuralNet::Process (  )  [pure virtual]

Runs one iteration through the network, reading the inputs and setting the outputs.

virtual void iPcNeuralNet::SetActivationFunc ( celNNActivationFunc  )  [pure virtual]

Sets the activation function of the neural network.

virtual void iPcNeuralNet::SetComplexity ( const char *  name  )  [pure virtual]

Sets the heuristic that will be used to set the sizes of each layer.

Alternatively you can call SetLayerSizes to set the sizes manually.

Acceptable values for the name parameter are:

  • "linear" (default) sizes progress linearly from inputs to outputs.
  • "halfLinear" like linear but first layer is 50% of the number of inputs.
  • "addHalfLinear" line linear but first layer is 150% the number of inputs.

virtual void iPcNeuralNet::SetInput ( size_t  index,
const celData value 
) [pure virtual]

Sets the value of one of the inputs.

virtual void iPcNeuralNet::SetInputs ( const csArray< celData > &  values  )  [pure virtual]

Sets all the input values in one go.

virtual void iPcNeuralNet::SetLayerSizes ( const csArray< size_t > &  sizes  )  [pure virtual]

Manually set the number of nodes in each hidden layer.

Alternatively you can call SetComplexity to have the sizes set automatically according to the selected heuristic.

virtual void iPcNeuralNet::SetSize ( size_t  inputs,
size_t  outputs,
size_t  layers 
) [pure virtual]

Sets the size of the neural network (number of inputs, outputs and hidden layers).

virtual bool iPcNeuralNet::SetWeights ( const iCelNNWeights in  )  [pure virtual]

Copies the weightings into the neural network from the given structure.

virtual bool iPcNeuralNet::Validate (  )  [pure virtual]

Returns true if the neural network is initialized and ready to use.

If it is not, then an attempt is made to initialize it, and the return value signifies success or failure of that attempt.


The documentation for this struct was generated from the following file:

Generated for CEL: Crystal Entity Layer 1.4.0 by doxygen 1.5.8