Open 3D Engine MachineLearning Gem API Reference
24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
This is a basic multilayer perceptron neural network capable of basic training and feed forward operations. More...
#include <MultilayerPerceptron.h>
Inherits MachineLearning::INeuralNetwork.
Public Member Functions | |
AZ_RTTI (MultilayerPerceptron, "{E12EF761-41A5-48C3-BF55-7179B280D45F}", INeuralNetwork) | |
MultilayerPerceptron (const MultilayerPerceptron &) | |
MultilayerPerceptron (AZStd::size_t activationCount) | |
MultilayerPerceptron & | operator= (const MultilayerPerceptron &) |
MultilayerPerceptron & | operator= (const ModelAsset &) |
void | AddLayer (AZStd::size_t layerDimensionality, ActivationFunctions activationFunction=ActivationFunctions::ReLU) |
Adds a new layer to the model. | |
Layer * | GetLayer (AZStd::size_t layerIndex) |
Retrieves a specific layer from the model, this is not thread safe and should only be used during unit testing to validate model parameters. | |
AZStd::string | GetName () const override |
AZStd::string | GetAssetFile (AssetTypes assetType) const override |
AZStd::size_t | GetInputDimensionality () const override |
Returns the number of input neurons the model supports. | |
AZStd::size_t | GetOutputDimensionality () const override |
Returns the number of output neurons the model supports. | |
AZStd::size_t | GetLayerCount () const override |
Returns the total number of layers in the network. | |
AZ::MatrixMxN | GetLayerWeights (AZStd::size_t layerIndex) const override |
AZ::VectorN | GetLayerBiases (AZStd::size_t layerIndex) const override |
AZStd::size_t | GetParameterCount () const override |
Returns the total number of parameters in the neural network. | |
IInferenceContextPtr | CreateInferenceContext () override |
ITrainingContextPtr | CreateTrainingContext () override |
const AZ::VectorN * | Forward (IInferenceContextPtr context, const AZ::VectorN &activations) override |
void | Reverse (ITrainingContextPtr context, LossFunctions lossFunction, const AZ::VectorN &activations, const AZ::VectorN &expected) override |
void | GradientDescent (ITrainingContextPtr context, float learningRate) override |
bool | LoadModel () override |
Loads the current model parameters from the associated asset file. | |
bool | SaveModel () override |
Saves the current model parameters to the associated asset file. | |
Public Member Functions inherited from MachineLearning::INeuralNetwork | |
AZ_RTTI (INeuralNetwork, "{64E5B5B1-4A7D-489D-9A29-D9510BB7E17A}") | |
INeuralNetwork (INeuralNetwork &&)=default | |
INeuralNetwork (const INeuralNetwork &)=default | |
INeuralNetwork & | operator= (INeuralNetwork &&)=default |
INeuralNetwork & | operator= (const INeuralNetwork &)=default |
virtual AZStd::string | GetAssetFile ([[maybe_unused]] AssetTypes assetType) const |
Returns the file where model parameters are stored. | |
virtual AZ::MatrixMxN | GetLayerWeights ([[maybe_unused]] AZStd::size_t layerIndex) const |
Returns the weight matrix for the requested layer. | |
virtual AZ::VectorN | GetLayerBiases ([[maybe_unused]] AZStd::size_t layerIndex) const |
Returns the weight matrix for the requested layer. | |
virtual const AZ::VectorN * | Forward ([[maybe_unused]] IInferenceContextPtr context, [[maybe_unused]] const AZ::VectorN &activations) |
Performs a basic feed-forward operation to compute the output from a set of activation values. | |
virtual void | Reverse ([[maybe_unused]] ITrainingContextPtr context, [[maybe_unused]] LossFunctions lossFunction, [[maybe_unused]] const AZ::VectorN &activations, [[maybe_unused]] const AZ::VectorN &expected) |
Accumulates the loss gradients given a loss function, an activation vector and a corresponding label vector. | |
virtual void | GradientDescent ([[maybe_unused]] ITrainingContextPtr context, [[maybe_unused]] float learningRate) |
Performs a gradient descent step and resets all gradient accumulators to zero. | |
void | add_ref () |
void | release () |
Static Public Member Functions | |
static void | Reflect (AZ::ReflectContext *context) |
Friends | |
class | MultilayerPerceptronEditorComponent |
This is a basic multilayer perceptron neural network capable of basic training and feed forward operations.
|
overridevirtual |
INeuralNetwork interface
Reimplemented from MachineLearning::INeuralNetwork.
|
static |
AzCore Reflection.
context | reflection context |