Navigation
API > API/Plugins > API/Plugins/LearningAgentsTraining
| Name | ULearningAgentsPPOTrainer |
| Type | class |
| Header File | /Engine/Plugins/Experimental/LearningAgents/Source/LearningAgentsTraining/Public/LearningAgentsPPOTrainer.h |
| Include Path | #include "LearningAgentsPPOTrainer.h" |
Syntax
UCLASS (MinimalAPI, BlueprintType, Blueprintable, Meta=(BlueprintSpawnableComponent))
class ULearningAgentsPPOTrainer : public ULearningAgentsManagerListener
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → ULearningAgentsManagerListener → ULearningAgentsPPOTrainer
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| -- Setup -- | LearningAgentsPPOTrainer.h | ||
ULearningAgentsPPOTrainer
(
FVTableHelper& Helper |
LearningAgentsPPOTrainer.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~ULearningAgentsPPOTrainer() |
LearningAgentsPPOTrainer.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActionId | int32 | LearningAgentsPPOTrainer.h | ||
| ActionModifierId | int32 | LearningAgentsPPOTrainer.h | ||
| bHasTrainingFailed | bool | True if trainer encountered an unrecoverable error during training (e.g. the trainer process timed out). | LearningAgentsPPOTrainer.h |
|
| bIsTraining | bool | True if training is currently in-progress. Otherwise, false. | LearningAgentsPPOTrainer.h |
|
| Critic | TObjectPtr< ULearningAgentsCritic > | The current critic. | LearningAgentsPPOTrainer.h |
|
| CriticNetworkId | int32 | LearningAgentsPPOTrainer.h | ||
| DecoderNetworkId | int32 | LearningAgentsPPOTrainer.h | ||
| EncoderNetworkId | int32 | LearningAgentsPPOTrainer.h | ||
| EpisodeBuffer | TUniquePtr< UE::Learning::FEpisodeBuffer > | LearningAgentsPPOTrainer.h | ||
| Interactor | TObjectPtr< ULearningAgentsInteractor > | --Private Data -- | LearningAgentsPPOTrainer.h |
|
| MemoryStateId | int32 | LearningAgentsPPOTrainer.h | ||
| ObservationId | int32 | LearningAgentsPPOTrainer.h | ||
| Policy | TObjectPtr< ULearningAgentsPolicy > | The current policy for experience gathering. | LearningAgentsPPOTrainer.h |
|
| PolicyNetworkId | int32 | LearningAgentsPPOTrainer.h | ||
| PreviousGameSettingsState | UE::Learning::Agents::FGameSettingsState | LearningAgentsPPOTrainer.h | ||
| ReplayBuffer | TUniquePtr< UE::Learning::FReplayBuffer > | LearningAgentsPPOTrainer.h | ||
| ReplayBufferId | int32 | LearningAgentsPPOTrainer.h | ||
| RewardId | int32 | LearningAgentsPPOTrainer.h | ||
| Trainer | TSharedPtr< UE::Learning::IExternalTrainer > | LearningAgentsPPOTrainer.h | ||
| TrainingEnvironment | TObjectPtr< ULearningAgentsTrainingEnvironment > | The training environment associated with this component. | LearningAgentsPPOTrainer.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginDestroy() |
Will automatically call EndTraining if training is still in-progress when the object is destroyed. | LearningAgentsPPOTrainer.h | |
void BeginTraining
(
const FLearningAgentsPPOTrainingSettings& TrainerTrainingSettings, |
Begins the training process with the provided settings. | LearningAgentsPPOTrainer.h |
|
void EndTraining() |
Stops the training process. | LearningAgentsPPOTrainer.h |
|
int32 GetEpisodeStepNum
(
const int32 AgentId |
Gets the number of step recorded in an episode for the given agent. | LearningAgentsPPOTrainer.h |
|
bool HasTrainingFailed () |
Returns true if the trainer has failed to communicate with the external training process. | LearningAgentsPPOTrainer.h |
|
const bool IsTraining () |
-- Training Process -- | LearningAgentsPPOTrainer.h |
|
virtual void OnAgentsAdded_Implementation
(
const TArray< int32 >& AgentIds |
LearningAgentsPPOTrainer.h | ||
virtual void OnAgentsRemoved_Implementation
(
const TArray< int32 >& AgentIds |
LearningAgentsPPOTrainer.h | ||
virtual void OnAgentsReset_Implementation
(
const TArray< int32 >& AgentIds |
LearningAgentsPPOTrainer.h | ||
void ProcessExperience
(
const bool bResetAgentsOnUpdate |
Call this function at the end of each step of your training loop. | LearningAgentsPPOTrainer.h |
|
void RunTraining
(
const FLearningAgentsPPOTrainingSettings& TrainerTrainingSettings, |
Convenience function that runs a basic training loop. | LearningAgentsPPOTrainer.h |
|
void SetupPPOTrainer
(
ULearningAgentsManager*& InManager, |
Initializes the trainer. | LearningAgentsPPOTrainer.h |
|
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static ULearningAgentsPPOTrainer * MakePPOTrainer
(
ULearningAgentsManager*& InManager, |
Constructs the trainer. | LearningAgentsPPOTrainer.h |
|