Struct Binary.CodeBook.Encoding
An encoding contains the necessary information to perform fast comparisons between fragments. Fragments represent either poses or trajectories and are automatically created for all animation frames the codebook covers.
Namespace: Unity.Kinematica
Syntax
public struct Encoding
Methods
FeatureDeviation(NativeArray<float3>, NativeArray<float3>)
Calculates the normalized deviation between normalized encodings.
Declaration
public float FeatureDeviation(NativeArray<float3> current, NativeArray<float3> candidate)
Parameters
Type | Name | Description |
---|---|---|
NativeArray<float3> | current | First element of the encoding pair. |
NativeArray<float3> | candidate | Second element of the encoding pair. |
Returns
Type | Description |
---|---|
Single | The normalized similarity value. |
Remarks
Given a pair of normalized feature encodings this method calculates a normalized value denoting the corresponding similarity value.
The resulting value is always in the range between 0 and 1. A value of 0 indicates perfect similarity and a value of 1 indicates the maximum possible deviation subject to the training data.
InverseNormalize(NativeArray<float3>)
Inverse normalizes all features of an encoding.
Declaration
public void InverseNormalize(NativeArray<float3> fragment)
Parameters
Type | Name | Description |
---|---|---|
NativeArray<float3> | fragment | Feature array that should be inverse normalized. |
InverseNormalize(NativeSlice<float3>, NativeArray<float3>)
Inverse normalizes all features of an encoding.
Declaration
public void InverseNormalize(NativeSlice<float3> destination, NativeArray<float3> features)
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<float3> | destination | Destination array that will contain the inverse normalized features. |
NativeArray<float3> | features | Source array that the features are read from. |
Remarks
Encodings contain fragments which represent either poses or trajectories. Fragments in turn store features that have been normalized subject to their respective domain (positions and velocities will be normalized differently).
See Also
Normalize(NativeArray<float3>)
Normalizes all features of an encoding.
Declaration
public void Normalize(NativeArray<float3> fragment)
Parameters
Type | Name | Description |
---|---|---|
NativeArray<float3> | fragment | Feature array that should be normalized. |
Normalize(NativeSlice<float3>, NativeArray<float3>)
Normalizes all features of an encoding.
Declaration
public void Normalize(NativeSlice<float3> destination, NativeArray<float3> features)
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<float3> | destination | Destination array that will contain the normalized features. |
NativeArray<float3> | features | Source array that the features are read from. |
Remarks
Encodings contain fragments which represent either poses or trajectories. Fragments in turn store features that have been normalized subject to their respective domain (positions and velocities will be normalized differently).