Open 3D Engine MachineLearning Gem API Reference 24.09.2
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
MachineLearning::INeuralNetwork Class Reference

Inherited by MachineLearning::MultilayerPerceptron.

Public Member Functions

 AZ_RTTI (INeuralNetwork, "{64E5B5B1-4A7D-489D-9A29-D9510BB7E17A}")
 
 INeuralNetwork (INeuralNetwork &&)=default
 
 INeuralNetwork (const INeuralNetwork &)=default
 
INeuralNetworkoperator= (INeuralNetwork &&)=default
 
INeuralNetworkoperator= (const INeuralNetwork &)=default
 
virtual AZStd::string GetName () const
 Returns a name for the model.
 
virtual AZStd::string GetAssetFile (AssetTypes assetType) const
 Returns the file where model parameters are stored.
 
virtual AZStd::size_t GetInputDimensionality () const
 Returns the number of input neurons the model supports.
 
virtual AZStd::size_t GetOutputDimensionality () const
 Returns the number of output neurons the model supports.
 
virtual AZStd::size_t GetLayerCount () const
 Returns the total number of layers in the network.
 
virtual AZ::MatrixMxN GetLayerWeights (AZStd::size_t layerIndex) const
 Returns the weight matrix for the requested layer.
 
virtual AZ::VectorN GetLayerBiases (AZStd::size_t layerIndex) const
 Returns the weight matrix for the requested layer.
 
virtual AZStd::size_t GetParameterCount () const
 Returns the total number of parameters in the neural network.
 
virtual IInferenceContextPtr CreateInferenceContext ()
 
virtual ITrainingContextPtr CreateTrainingContext ()
 
virtual const AZ::VectorN * Forward (IInferenceContextPtr context, const AZ::VectorN &activations)
 Performs a basic feed-forward operation to compute the output from a set of activation values.
 
virtual void Reverse (ITrainingContextPtr context, LossFunctions lossFunction, const AZ::VectorN &activations, const AZ::VectorN &expected)
 Accumulates the loss gradients given a loss function, an activation vector and a corresponding label vector.
 
virtual void GradientDescent (ITrainingContextPtr context, float learningRate)
 Performs a gradient descent step and resets all gradient accumulators to zero.
 
virtual bool LoadModel ()
 Loads the current model parameters from the associated asset file.
 
virtual bool SaveModel ()
 Saves the current model parameters to the associated asset file.
 
void add_ref ()
 
void release ()
 

Member Function Documentation

◆ add_ref()

void MachineLearning::INeuralNetwork::add_ref ( )
inline

For intrusive_ptr support

◆ Forward()

virtual const AZ::VectorN * MachineLearning::INeuralNetwork::Forward ( IInferenceContextPtr context,
const AZ::VectorN & activations )
inlinevirtual

Performs a basic feed-forward operation to compute the output from a set of activation values.

Reimplemented in MachineLearning::MultilayerPerceptron.

◆ GetAssetFile()

virtual AZStd::string MachineLearning::INeuralNetwork::GetAssetFile ( AssetTypes assetType) const
inlinevirtual

Returns the file where model parameters are stored.

Reimplemented in MachineLearning::MultilayerPerceptron.

◆ GetInputDimensionality()

virtual AZStd::size_t MachineLearning::INeuralNetwork::GetInputDimensionality ( ) const
inlinevirtual

Returns the number of input neurons the model supports.

Reimplemented in MachineLearning::MultilayerPerceptron.

◆ GetLayerBiases()

virtual AZ::VectorN MachineLearning::INeuralNetwork::GetLayerBiases ( AZStd::size_t layerIndex) const
inlinevirtual

Returns the weight matrix for the requested layer.

Reimplemented in MachineLearning::MultilayerPerceptron.

◆ GetLayerCount()

virtual AZStd::size_t MachineLearning::INeuralNetwork::GetLayerCount ( ) const
inlinevirtual

Returns the total number of layers in the network.

Reimplemented in MachineLearning::MultilayerPerceptron.

◆ GetLayerWeights()

virtual AZ::MatrixMxN MachineLearning::INeuralNetwork::GetLayerWeights ( AZStd::size_t layerIndex) const
inlinevirtual

Returns the weight matrix for the requested layer.

Reimplemented in MachineLearning::MultilayerPerceptron.

◆ GetName()

virtual AZStd::string MachineLearning::INeuralNetwork::GetName ( ) const
inlinevirtual

Returns a name for the model.

Reimplemented in MachineLearning::MultilayerPerceptron.

◆ GetOutputDimensionality()

virtual AZStd::size_t MachineLearning::INeuralNetwork::GetOutputDimensionality ( ) const
inlinevirtual

Returns the number of output neurons the model supports.

Reimplemented in MachineLearning::MultilayerPerceptron.

◆ GetParameterCount()

virtual AZStd::size_t MachineLearning::INeuralNetwork::GetParameterCount ( ) const
inlinevirtual

Returns the total number of parameters in the neural network.

Reimplemented in MachineLearning::MultilayerPerceptron.

◆ GradientDescent()

virtual void MachineLearning::INeuralNetwork::GradientDescent ( ITrainingContextPtr context,
float learningRate )
inlinevirtual

Performs a gradient descent step and resets all gradient accumulators to zero.

Reimplemented in MachineLearning::MultilayerPerceptron.

◆ LoadModel()

virtual bool MachineLearning::INeuralNetwork::LoadModel ( )
inlinevirtual

Loads the current model parameters from the associated asset file.

Reimplemented in MachineLearning::MultilayerPerceptron.

◆ Reverse()

virtual void MachineLearning::INeuralNetwork::Reverse ( ITrainingContextPtr context,
LossFunctions lossFunction,
const AZ::VectorN & activations,
const AZ::VectorN & expected )
inlinevirtual

Accumulates the loss gradients given a loss function, an activation vector and a corresponding label vector.

Reimplemented in MachineLearning::MultilayerPerceptron.

◆ SaveModel()

virtual bool MachineLearning::INeuralNetwork::SaveModel ( )
inlinevirtual

Saves the current model parameters to the associated asset file.

Reimplemented in MachineLearning::MultilayerPerceptron.


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