NevarokML: UNevarokMLSpace API
The UNevarokMLSpace
class represents a space in the NevarokML plugin. It provides various methods to create and manipulate different types of spaces.
Properties
_shape
(TArray<int32>
): An array of integers representing the shape of the space._stack
(TArray<int32>
): An array of integers representing the stack dimension of the space._n
(int64
): An integer representing the size of the space._num
(int32
): An integer representing the number of elements in the space._low
(TArray<float>
): An array of floats representing the lower bounds of the space._high
(TArray<float>
): An array of floats representing the upper bounds of the space._nVec
(TArray<int64>
): An array of integers representing the number of actions for each discrete action space._nneShapes
(TArray<UE::NNECore::FTensorShape>
): An array ofUE::NNECore::FTensorShape
objects representing the shapes of the space in the NNECore library.
Methods
IsValid
Checks if the space is valid. Returns true
if the space is valid, and false
otherwise.
Discrete
UFUNCTION(BlueprintPure, Category = "NevarokML|Space")
static UNevarokMLSpace* Discrete(UObject* owner, int64 size = 1);
Creates a discrete space. The size
parameter specifies the number of discrete actions in the space. Returns an instance of UNevarokMLSpace
representing the discrete space.
MultiDiscrete
UFUNCTION(BlueprintPure, Category = "NevarokML|Space")
static UNevarokMLSpace* MultiDiscrete(UObject* owner, const TArray<int64>& vec);
Creates a multi-discrete space. The vec
parameter is an array of positive integers specifying the number of actions for each discrete action space. Returns an instance of UNevarokMLSpace
representing the multi-discrete space.
MultiBinary
UFUNCTION(BlueprintPure, Category = "NevarokML|Space")
static UNevarokMLSpace* MultiBinary(UObject* owner, int32 size = 1);
Creates a multi-binary space. The size
parameter specifies the number of binary actions in the space. Returns an instance of UNevarokMLSpace
representing the multi-binary space.
Continuous
UFUNCTION(BlueprintPure, Category = "NevarokML|Space")
static UNevarokMLSpace* Continuous(UObject* owner, int size, const TArray<float>& min, const TArray<float>& max);
size
parameter specifies the length of the space. The min
and max
arrays define the lower and upper bounds for each element of the space. Returns an instance of UNevarokMLSpace
representing the continuous space.
Box
UFUNCTION(BlueprintPure, Category = "NevarokML|Space")
static UNevarokMLSpace* Box(UObject* owner, FNevarokMLIndex2D size, const TArray<float>& min, const TArray<float>& max);
size
parameter is a 2D index specifying the shape of the box space. The min
and max
arrays define the lower and upper bounds for each element of the box space. Returns an instance of UNevarokMLSpace
representing the box space.
MultiDiscreteStack
UFUNCTION(BlueprintPure, Category = "NevarokML|Space")
static UNevarokMLSpace* MultiDiscreteStack(UObject* owner, const TArray<int64>& vec, int stack = 1);
MultiBinaryStack
UFUNCTION(BlueprintPure, Category = "NevarokML|Space")
static UNevarokMLSpace* MultiBinaryStack(UObject* owner, int32 size = 1, int stack = 1);
ContinuousStack
UFUNCTION(BlueprintPure, Category = "NevarokML|Space")
static UNevarokMLSpace* ContinuousStack(UObject* owner, int size, const TArray<float>& min, const TArray<float>& max, int stack = 1);
BoxDXStack
UFUNCTION(BlueprintPure, Category = "NevarokML|Space")
static UNevarokMLSpace* BoxDXStack(UObject* owner, FNevarokMLIndex2D size, const TArray<float>& min, const TArray<float>& max, int stack = 1);
BoxDYStack
UFUNCTION(BlueprintPure, Category = "NevarokML|Space")
static UNevarokMLSpace* BoxDYStack(UObject* owner, FNevarokMLIndex2D size, const TArray<float>& min, const TArray<float>& max, int stack = 1);
ToDiscrete
Converts the space to a discrete space with the specified size. Updates the space in-place.ToMultiDiscrete
UFUNCTION(BlueprintCallable, Category = "NevarokML|Space")
void ToMultiDiscrete(const TArray<int64>& vec);
ToMultiBinary
Converts the space to a multi-binary space with the specified size. Updates the space in-place.ToContinuous
UFUNCTION(BlueprintCallable, Category = "NevarokML|Space")
void ToContinuous(int size, const TArray<float>& min, const TArray<float>& max);
ToBox
UFUNCTION(BlueprintCallable, Category = "NevarokML|Space")
void ToBox(FNevarokMLIndex2D size, const TArray<float>& min, const TArray<float>& max);
ToMultiDiscreteStack
UFUNCTION(BlueprintCallable, Category = "NevarokML|Space")
void ToMultiDiscreteStack(const TArray<int64>& vec, int stack);
ToMultiBinaryStack
UFUNCTION(BlueprintCallable, Category = "NevarokML|Space")
void ToMultiBinaryStack(int32 size, int stack);
ToContinuousStack
UFUNCTION(BlueprintCallable, Category = "NevarokML|Space")
void ToContinuousStack(int size, const TArray<float>& min, const TArray<float>& max, int stack);
ToBoxDXStack
UFUNCTION(BlueprintCallable, Category = "NevarokML|Space")
void ToBoxDXStack(FNevarokMLIndex2D size, const TArray<float>& min, const TArray<float>& max, int stack);
ToBoxDYStack
UFUNCTION(BlueprintCallable, Category = "NevarokML|Space")
void ToBoxDYStack(FNevarokMLIndex2D size, const TArray<float>& min, const TArray<float>& max, int stack);