Navigation
API > API/Plugins > API/Plugins/LearningTraining
Trainer that connects to an external training server to perform training
This trainer can be used to allow the python training process the run on a different machine to the experience gathering process.
| Name | FSharedMemoryTrainer |
| Type | struct |
| Header File | /Engine/Plugins/Experimental/LearningAgents/Source/LearningTraining/Public/LearningExternalTrainer.h |
| Include Path | #include "LearningExternalTrainer.h" |
Syntax
struct FSharedMemoryTrainer : public UE::Learning::IExternalTrainer
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FSharedMemoryTrainer
(
const FString& InTaskName, |
Creates a new SharedMemory trainer | LearningExternalTrainer.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FSharedMemoryTrainer() |
LearningExternalTrainer.h |
Structs
| Name | Remarks |
|---|---|
| FSharedMemoryExperienceContainer |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bUseExternalTrainer | bool | LearningExternalTrainer.h | ||
| ConfigPath | FString | LearningExternalTrainer.h | ||
| Controls | TSharedMemoryArrayView< 1, volatile int32 > | LearningExternalTrainer.h | ||
| IntermediatePath | FString | LearningExternalTrainer.h | ||
| NeuralNetworkSharedMemoryArrayViews | TArray< TSharedMemoryArrayView< 1, uint8 > > | LearningExternalTrainer.h | ||
| SharedMemoryExperienceContainers | TArray< FSharedMemoryExperienceContainer > | LearningExternalTrainer.h | ||
| TaskName | FString | LearningExternalTrainer.h | ||
| Timeout | float | LearningExternalTrainer.h | ||
| TrainingProcess | TSharedPtr< FSharedMemoryTrainerServerProcess > | LearningExternalTrainer.h |
Functions
Public
Overridden from IExternalTrainer
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual int32 AddNetwork
(
const ULearningNeuralNetworkData& Network |
Adds the network to this external trainer. | LearningExternalTrainer.h | |
virtual int32 AddReplayBuffer
(
const FReplayBuffer& ReplayBuffer |
Adds a named replay buffer to this external trainer. | LearningExternalTrainer.h | |
virtual bool HasNetworkOrCompleted() |
Returns true if we can receive a network or training completed. Otherwise, false. | LearningExternalTrainer.h | |
virtual bool IsValid() |
Returns true if this trainer is valid. Otherwise, false. | LearningExternalTrainer.h | |
virtual ETrainerResponse ReceiveNetwork
(
const int32 NetworkId, |
Wait for the trainer to push an updated network. | LearningExternalTrainer.h | |
virtual TArray< ETrainerResponse > ReceiveNetworks
(
const TArray< int32 >& NetworkIds, |
Wait for the trainer to push an array of updated networks. | LearningExternalTrainer.h | |
virtual ETrainerResponse SendConfigs
(
const TSharedRef< FJsonObject >& DataConfigObject, |
Sends the given json configs to the trainer process. | LearningExternalTrainer.h | |
virtual ETrainerResponse SendNetwork
(
const int32 NetworkId, |
Wait for the trainer to be ready and push the current policy network. | LearningExternalTrainer.h | |
virtual ETrainerResponse SendReplayBuffer
(
const int32 ReplayBufferId, |
Wait for the trainer to be ready and send new experience. | LearningExternalTrainer.h | |
virtual ETrainerResponse SendStop() |
Signal for the trainer to stop. | LearningExternalTrainer.h | |
virtual void Terminate() |
Terminate the trainer immediately. | LearningExternalTrainer.h | |
virtual ETrainerResponse Wait() |
Wait for the trainer to finish. | LearningExternalTrainer.h |