Navigation
API > API/Plugins > API/Plugins/LearningAgentsTraining
The ULearningAgentsImitationTrainer enable imitation learning, i.e. learning from human/AI demonstrations. Imitation training is typically much faster than reinforcement learning, but requires gathering large amounts of data in order to generalize. This can be used to initialize a reinforcement learning policy to speed up initial exploration.
| Name | ULearningAgentsImitationTrainer |
| Type | class |
| Header File | /Engine/Plugins/Experimental/LearningAgents/Source/LearningAgentsTraining/Public/LearningAgentsImitationTrainer.h |
| Include Path | #include "LearningAgentsImitationTrainer.h" |
Syntax
UCLASS (MinimalAPI, BlueprintType, Blueprintable)
class ULearningAgentsImitationTrainer : public ULearningAgentsManagerListener
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → ULearningAgentsManagerListener → ULearningAgentsImitationTrainer
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| -- Setup -- | LearningAgentsImitationTrainer.h | ||
ULearningAgentsImitationTrainer
(
FVTableHelper& Helper |
LearningAgentsImitationTrainer.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~ULearningAgentsImitationTrainer() |
LearningAgentsImitationTrainer.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ActionId | int32 | LearningAgentsImitationTrainer.h | ||
| bHasTrainingFailed | bool | True if trainer encountered an unrecoverable error during training (e.g. the trainer process timed out). | LearningAgentsImitationTrainer.h |
|
| bIsTraining | bool | True if training is currently in-progress. Otherwise, false. | LearningAgentsImitationTrainer.h |
|
| DecoderNetworkId | int32 | LearningAgentsImitationTrainer.h | ||
| EncoderNetworkId | int32 | LearningAgentsImitationTrainer.h | ||
| Interactor | TObjectPtr< ULearningAgentsInteractor > | --Private Data -- | LearningAgentsImitationTrainer.h |
|
| MemoryStateId | int32 | LearningAgentsImitationTrainer.h | ||
| ObservationId | int32 | LearningAgentsImitationTrainer.h | ||
| Policy | TObjectPtr< ULearningAgentsPolicy > | The policy being trained. | LearningAgentsImitationTrainer.h |
|
| PolicyNetworkId | int32 | LearningAgentsImitationTrainer.h | ||
| ReplayBuffer | TUniquePtr< UE::Learning::FReplayBuffer > | LearningAgentsImitationTrainer.h | ||
| ReplayBufferId | int32 | LearningAgentsImitationTrainer.h | ||
| Trainer | TSharedPtr< UE::Learning::IExternalTrainer > | LearningAgentsImitationTrainer.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. | LearningAgentsImitationTrainer.h | |
void BeginTraining
(
const ULearningAgentsRecording* Recording, |
Begins the training process with the provided settings. | LearningAgentsImitationTrainer.h |
|
void EndTraining() |
Stops the training process. | LearningAgentsImitationTrainer.h |
|
bool HasTrainingFailed () |
Returns true if the trainer has failed to communicate with the external training process. | LearningAgentsImitationTrainer.h |
|
bool IsTraining() |
Returns true if the trainer is currently training; Otherwise, false. | LearningAgentsImitationTrainer.h |
|
void IterateTraining() |
Iterates the training process and gets the updated policy network. | LearningAgentsImitationTrainer.h |
|
void RunTraining
(
const ULearningAgentsRecording* Recording, |
Convenience function that runs a basic training loop. | LearningAgentsImitationTrainer.h |
|
void SetupImitationTrainer
(
ULearningAgentsManager* InManager, |
Initializes the imitation trainer and runs the setup functions. | LearningAgentsImitationTrainer.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static ULearningAgentsImitationTrainer * MakeImitationTrainer
(
ULearningAgentsManager*& InManager, |
Constructs the imitation trainer and runs the setup functions. | LearningAgentsImitationTrainer.h |
|
See Also
-
ULearningAgentsInteractor to understand how observations and actions work.
-
ULearningAgentsController to understand how we can manually perform actions via a human or AI.
-
ULearningAgentsRecorder to understand how to make new recordings.