Struct FDictSpace

struct FDictSpace

A struct representing a dictionary of possible observations or actions.

Public Functions

FDictSpace()

Construct an empty DictSpace.

int Num()

Get the number of spaces in this dictionary.

Returns:

The number of spaces in this dictionary

int GetFlattenedSize() const

Get the number of dimensions, of all spaces in this dictionary after flattening.

Returns:

The number of dimensions

ESpaceValidationResult Validate(FDictPoint &PointMap) const

Validate a point in this space, by checking if all of it’s dimensions pass validation.

Parameters:

PointMap[in] The point to validate

Returns:

An enum indicating the result of the validation

void NormalizeObservation(FDictPoint &Observations) const

Normalize an observation in this space, by normalizing each of it’s dimensions.

Parameters:

Observations[inout] The observation to normalize

void Reset()
TSpace &Add(const FString &Key)

Create a new empty space in place in this dictionary.

Parameters:

Key[in] The label of the space

Returns:

A reference to the newly added space

void Add(const FString &Key, TSpace &Value)

Add a preallocated space from a reference to this dictionary.

Parameters:
  • Key[in] The label of the space

  • Value[in] The BoxSpace to add

void Add(const FString &Key, FBoxSpace &Value)

Add a BoxSpace to this dictionary from a reference.

Parameters:
  • Key[in] The label of the space

  • Value[in] The BoxSpace to add

void Add(const FString &Key, FDiscreteSpace &Value)

Add a DiscreteSpace to this dictionary from a reference.

Parameters:
  • Key[in] The label of the space

  • Value[in] The DiscreteSpace to add

void Add(const FString &Key, FBinarySpace &Value)

Add a BinarySpace to this dictionary from a reference.

Parameters:
  • Key[in] The label of the space

  • Value[in] The BinarySpace to add

void Append(const FDictSpace &Other)

Append another DictSpace to this one.

Parameters:

Other[in] The DictSpace to append

DictSpace *ToProtobuf() const

Convert this DictSpace to a protobuf message.

Returns:

A protobuf message representing this DictSpace

void FillProtobuf(DictSpace *Msg) const

Fill a protobuf message with the data from this DictSpace.

Parameters:

Msg[in] The protobuf message to fill

void InitializeEmptyDictPoint(FDictPoint &EmptyPoint)

Configure an empty DictPoint with the correct entries corresponding to this space.

Parameters:

EmptyPoint[inout] The point to initialize

FDictPoint UnflattenPoint(TArray<float> &FlattenedPoint)

Create an empty DictPoint from a flattened point.

Parameters:

FlattenedPoint[in] The flattened point buffer to unflatten

Returns:

The unflattened point

FGenericTensorBinding CreateTensorBinding(TArray<float> &Buffer) const

Create an empty Tensor Binding with correct size to hold a point from this DictSpace.

Parameters:

Buffer[in] The buffer that will contain the memory in the tensor binding

Returns:

The empty tensor binding

FGenericTensorBinding CreateTensorBinding(TArray<float> &Buffer, const FDictPoint &Point) const

Create a Tensor Binding containing a point from this DictSpace.

Parameters:
  • Buffer[inout] The buffer that will contain the memory in the tensor binding

  • Point[in] The point to create a tensor from

Returns:

The tensor binding

inline TSpace &operator[](int Index)

Get a subspace from this DictSpace, from an Index.

Parameters:

Index[in] The index of the subspace

Returns:

The subspace

inline TSpace &operator[](const FString &Label)

Get a subspace from this DictSpace, from a Label.

Parameters:

Label[in] The label of the subspace

Returns:

The subspace

Public Members

TArray<FString> Labels

The labels of the spaces in this dictionary, used as keys for lookups.

TArray<TSpace> Spaces

The spaces in this dictionary.

Related pages

  • Visit the Schola product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNA™ 2 GPUs, AMD Ryzen™ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!