Navigation
API > API/Plugins > API/Plugins/LearningAgents
A critic used for training the policy. Can be used at inference time to estimate the discounted returns.
| Name | ULearningAgentsCritic |
| Type | class |
| Header File | /Engine/Plugins/Experimental/LearningAgents/Source/LearningAgents/Public/LearningAgentsCritic.h |
| Include Path | #include "LearningAgentsCritic.h" |
Syntax
UCLASS (MinimalAPI, BlueprintType, Blueprintable, Meta=(BlueprintSpawnableComponent))
class ULearningAgentsCritic : public ULearningAgentsManagerListener
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → ULearningAgentsManagerListener → ULearningAgentsCritic
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| These constructors/destructors are needed to make forward declarations happy. | LearningAgentsCritic.h | ||
ULearningAgentsCritic
(
FVTableHelper& Helper |
LearningAgentsCritic.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~ULearningAgentsCritic() |
LearningAgentsCritic.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CriticNetwork | TObjectPtr< ULearningAgentsNeuralNetwork > | The underlying neural network. | LearningAgentsCritic.h |
|
| CriticObject | TSharedPtr< UE::Learning::FNeuralNetworkCritic > | Internal Critic Function Object | LearningAgentsCritic.h | |
| Interactor | TObjectPtr< ULearningAgentsInteractor > | --Private Data -- | LearningAgentsCritic.h |
|
| Policy | TObjectPtr< ULearningAgentsPolicy > | The policy this critic is associated with. | LearningAgentsCritic.h |
|
| Returns | TLearningArray< 1, float, TInlineAllocator< 32 > > | Buffer to store the computed returns for each agent | LearningAgentsCritic.h | |
| ReturnsIteration | TLearningArray< 1, uint64, TInlineAllocator< 32 > > | Number of times the returns have been computed for all agents | LearningAgentsCritic.h | |
| ValidAgentIds | TArray< int32 > | Temp buffers used to record the set of agents that are valid for evaluation | LearningAgentsCritic.h | |
| ValidAgentSet | UE::Learning::FIndexSet | LearningAgentsCritic.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void EvaluateCritic () |
-- Blueprint public interface -- | LearningAgentsCritic.h |
|
ULearningAgentsNeuralNetwork * GetCriticNetworkAsset() |
Gets the current Network Asset being used | LearningAgentsCritic.h |
|
| -- Non-blueprint public interface -- | LearningAgentsCritic.h | ||
float GetEstimatedDiscountedReturn
(
const int32 AgentId |
Gets an estimate of the average discounted return expected by an agent according to the critic. | LearningAgentsCritic.h |
|
virtual void OnAgentsAdded_Implementation
(
const TArray< int32 >& AgentIds |
LearningAgentsCritic.h | ||
virtual void OnAgentsRemoved_Implementation
(
const TArray< int32 >& AgentIds |
LearningAgentsCritic.h | ||
virtual void OnAgentsReset_Implementation
(
const TArray< int32 >& AgentIds |
LearningAgentsCritic.h | ||
void SetupCritic
(
ULearningAgentsManager*& InManager, |
Initializes a critic to be used with the given agent interactor and critic settings. | LearningAgentsCritic.h |
|
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static ULearningAgentsCritic * MakeCritic
(
ULearningAgentsManager*& InManager, |
Constructs a Critic to be used with the given agent interactor and critic settings. | LearningAgentsCritic.h |
|