Navigation
API > API/Plugins > API/Plugins/NeuralMorphModel
The neural morph model. This generates a set of highly compressed morph targets to approximate a target deformation based on bone rotations and/or curve inputs. During inference, the neural network inside this model runs on the CPU and outputs the morph target weights for the morph targets it generated during training. Groups of bones and curves can also be defined. Those groups will generate a set of morph targets together as well. This can help when shapes depend on multiple inputs. An external morph target set is generated during training and serialized inside the ML Deformer asset that contains this model. When the ML Deformer component initializes the morph target set is registered. Most of the heavy lifting is done by the UMLDeformerMorphModel class. The neural morph model has two modes: local and global. See the ENeuralMorphMode for a description of the two.
| Name | UNeuralMorphModel |
| Type | class |
| Header File | /Engine/Plugins/Animation/MLDeformer/NeuralMorphModel/Source/NeuralMorphModel/Public/NeuralMorphModel.h |
| Include Path | #include "NeuralMorphModel.h" |
Syntax
UCLASS (MinimalAPI)
class UNeuralMorphModel : public UMLDeformerMorphModel
Inheritance Hierarchy
- UMLDeformerModel → UMLDeformerGeomCacheModel → UMLDeformerMorphModel → UNeuralMorphModel
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UNeuralMorphModel
(
const FObjectInitializer& ObjectInitializer |
NeuralMorphModel.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| BatchSize | int32 | The number of frames per batch when training the model. | NeuralMorphModel.h |
|
| bEnableBoneMasks | bool | Enable the use of per bone and bone group masks. | NeuralMorphModel.h |
|
| BoneGroupMaskInfoMap | TMap< FName, FMLDeformerMaskInfo > | Information needed to generate a mask for each bone group. | NeuralMorphModel.h | |
| BoneGroups | TArray< FNeuralMorphBoneGroup > | The set of bones that are grouped together and generate morph targets together as a whole. | NeuralMorphModel.h | |
| BoneMaskInfoMap | TMap< FName, FMLDeformerMaskInfo > | Information needed to generate a mask for each bone. | NeuralMorphModel.h | |
| CurveGroups | TArray< FNeuralMorphCurveGroup > | The set of curves that are grouped together and generate morph targets together as a whole. | NeuralMorphModel.h | |
| GlobalNumHiddenLayers | int32 | The number of hidden layers that the neural network model will have.\nHigher numbers will slow down performance but can deal with more complex deformations. | NeuralMorphModel.h |
|
| GlobalNumMorphTargets | int32 | The number of morph targets to generate in total. | NeuralMorphModel.h |
|
| GlobalNumNeuronsPerLayer | int32 | The number of units/neurons per hidden layer. | NeuralMorphModel.h |
|
| LearningRate | float | The learning rate used during the model training. | NeuralMorphModel.h |
|
| LocalNumHiddenLayers | int32 | The number of hidden layers that the neural network model will have. | NeuralMorphModel.h |
|
| LocalNumMorphTargetsPerBone | int32 | The number of morph targets to generate per bone, curve or group. | NeuralMorphModel.h |
|
| LocalNumNeuronsPerLayer | int32 | The number of units/neurons per hidden layer. | NeuralMorphModel.h |
|
| Mode | ENeuralMorphMode | The mode that the neural network will operate in. | NeuralMorphModel.h |
|
| NeuralMorphNetwork | TObjectPtr< UNeuralMorphNetwork > | The neural morph model network. | NeuralMorphModel.h | |
| NumIterations | int32 | The number of iterations to train the model for. | NeuralMorphModel.h |
|
| RegularizationFactor | float | The regularization factor. | NeuralMorphModel.h |
|
| SkinningMode | EMLDeformerSkinningMode | The base skinning mode to use. | NeuralMorphModel.h |
|
| SmoothLossBeta | float | The beta parameter in the smooth L1 loss function, which describes below which absolute error to use a squared term. | NeuralMorphModel.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual UMLDeformerInputInfo * CreateInputInfo() |
NeuralMorphModel.h | ||
virtual UMLDeformerModelInstance * CreateModelInstance
(
UMLDeformerComponent* Component |
NeuralMorphModel.h | ||
virtual void GetAssetRegistryTags
(
FAssetRegistryTagsContext Context |
NeuralMorphModel.h | ||
virtual void GetAssetRegistryTags
(
TArray< FAssetRegistryTag >& OutTags |
NeuralMorphModel.h | ||
int32 GetBatchSize() |
NeuralMorphModel.h | ||
const TArray< FNeuralMorphBoneGroup > & GetBoneGroups() |
NeuralMorphModel.h | ||
const TArray< FNeuralMorphCurveGroup > & GetCurveGroups() |
NeuralMorphModel.h | ||
virtual FString GetDisplayName() |
NeuralMorphModel.h | ||
int32 GetGlobalNumHiddenLayers() |
NeuralMorphModel.h | ||
int32 GetGlobalNumMorphs() |
NeuralMorphModel.h | ||
int32 GetGlobalNumNeuronsPerLayer() |
NeuralMorphModel.h | ||
float GetLearningRate() |
NeuralMorphModel.h | ||
int32 GetLocalNumHiddenLayers() |
NeuralMorphModel.h | ||
int32 GetLocalNumMorphsPerBone() |
NeuralMorphModel.h | ||
int32 GetLocalNumMorphsPerBoneOrCurve() |
NeuralMorphModel.h | ||
int32 GetLocalNumNeuronsPerLayer() |
NeuralMorphModel.h | ||
ENeuralMorphMode GetModelMode() |
NeuralMorphModel.h | ||
UNeuralMorphNetwork * GetNeuralMorphNetwork() |
NeuralMorphModel.h | ||
virtual int32 GetNumFloatsPerCurve() |
NeuralMorphModel.h | ||
int32 GetNumIterations() |
NeuralMorphModel.h | ||
float GetRegularizationFactor() |
NeuralMorphModel.h | ||
EMLDeformerSkinningMode GetSkinningMode() |
NeuralMorphModel.h | ||
float GetSmoothLossBeta() |
NeuralMorphModel.h | ||
bool IsBoneMaskingEnabled() |
NeuralMorphModel.h | ||
virtual bool IsTrained() |
NeuralMorphModel.h | ||
virtual void PostLoad() |
NeuralMorphModel.h | ||
virtual void Serialize
(
FArchive& Archive |
NeuralMorphModel.h | ||
void SetNeuralMorphNetwork
(
UNeuralMorphNetwork* Net |
NeuralMorphModel.h | ||
void SetNumIterations
(
int32 InNumIterations |
NeuralMorphModel.h | ||
void SetSkinningMode
(
EMLDeformerSkinningMode SkinMode |
NeuralMorphModel.h | ||
virtual bool SupportsGlobalModeOnly () |
Check if only global mode should be supported or not. | NeuralMorphModel.h | |
void UpdateMissingGroupNames() |
NeuralMorphModel.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FName GetModePropertyName() |
NeuralMorphModel.h | ||
static FName GetSkinningModePropertyName() |
NeuralMorphModel.h |
Deprecated Variables
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| BoneGroupMaskInfos_DEPRECATED | TMap< FName, FNeuralMorphMaskInfo > | NeuralMorphModel.h |
|
|
| BoneMaskInfos_DEPRECATED | PRAGMA_DISABLE_DEPRECATION_WARNINGSTMap< FName, FNeuralMorphMaskInfo > | NeuralMorphModel.h |
|