Navigation
API > API/Plugins > API/Plugins/Learning
Neural Network Data Object
This is the UObject which contains the actual data used by a Neural Network. It stores the raw FileData used to construct the network using NNE, as well as the input and output sizes and a compatibility hash that can be used to quickly check if two networks may be compatible in terms of inputs and outputs.
Internally this also stores the various things required to map between NNE style inference and the style of inference used in Learning via FNeuralNetwork and FNeuralNetworkInference.
| Name | ULearningNeuralNetworkData |
| Type | class |
| Header File | /Engine/Plugins/Experimental/LearningAgents/Source/Learning/Public/LearningNeuralNetwork.h |
| Include Path | #include "LearningNeuralNetwork.h" |
Syntax
UCLASS (MinimalAPI, BlueprintType)
class ULearningNeuralNetworkData : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → ULearningNeuralNetworkData
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CompatibilityHash | int32 | Compatibility hash used for testing if inputs to one network are compatible with another. | LearningNeuralNetwork.h |
|
| ContentHash | int32 | Content hash which can be used to see when the network data has changed. | LearningNeuralNetwork.h |
|
| FileData | TArray< uint8 > | File data used by NNE. | LearningNeuralNetwork.h | |
| InputSize | int32 | Size of the inputs expected by this network. | LearningNeuralNetwork.h |
|
| ModelData | TObjectPtr< UNNEModelData > | Model Data used by NNE. | LearningNeuralNetwork.h | |
| Network | TSharedPtr< UE::Learning::FNeuralNetwork > | Internal in-memory network representation. | LearningNeuralNetwork.h | |
| OutputSize | int32 | Size of the output produced by this network. | LearningNeuralNetwork.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 GetCompatibilityHash() |
Gets the compatibility hash. | LearningNeuralNetwork.h | |
int32 GetContentHash() |
Gets the content hash. | LearningNeuralNetwork.h | |
int32 GetInputSize() |
Gets the network input size. | LearningNeuralNetwork.h | |
TSharedPtr< UE::Learning::FNeuralNetwork > & GetNetwork() |
Get the FNeuralNetwork object that can be used to do inference. | LearningNeuralNetwork.h | |
int32 GetOutputSize() |
Gets the network output size. | LearningNeuralNetwork.h | |
int32 GetSnapshotByteNum() |
Number of bytes required to save or load a snapshot of this network. | LearningNeuralNetwork.h | |
void Init
(
const int32 InInputSize, |
Initialize the ULearningNeuralNetworkData object given some input and output sizes as well as a compatibility hash and FileData. | LearningNeuralNetwork.h | |
void InitFrom
(
const ULearningNeuralNetworkData* OtherNetworkData |
Initialize this network from another ULearningNeuralNetworkData object. | LearningNeuralNetwork.h | |
bool IsEmpty() |
If this network is empty or not. | LearningNeuralNetwork.h | |
bool LoadFromSnapshot
(
const TArrayView< const uint8 > InBytes |
Load a snapshot of this network from the given array of bytes. | LearningNeuralNetwork.h | |
void SaveToSnapshot
(
TArrayView< uint8 > OutBytes |
Save a snapshot of this network to the given array of bytes. | LearningNeuralNetwork.h |