unreal.LearningAgentsRecorder¶
- class unreal.LearningAgentsRecorder(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
LearningAgentsManagerListenerA component that can be used to create recordings of training data for imitation learning.
C++ Source:
Plugin: LearningAgents
Module: LearningAgentsTraining
File: LearningAgentsRecorder.h
Editor Properties: (see get_editor_property/set_editor_property)
interactor(LearningAgentsInteractor): [Read-Only] The agent interactor this recorder is associated with.is_recording(bool): [Read-Only] True if recording is currently in-progress. Otherwise, false.is_setup(bool): [Read-Only] True if this object has been setup. Otherwise, false.manager(LearningAgentsManager): [Read-Only] The manager this object is associated with.on_recording_begin(OnRecordingBeginSignature): [Read-Write] Called after the recording has startedon_recording_end(OnRecordingEndSignature): [Read-Write] Called after the recording has stoppedrecording(LearningAgentsRecording): [Read-Only] The current recording object.visual_logger_objects(Map[Name, LearningAgentsVisualLoggerObject]): [Read-Only] The visual logger objects associated with this listener.
- add_experience() None¶
While recording, adds the current buffered observations and actions of the added agents to the internal buffer. Call this after GatherObservations and either EvaluateAgentController (if recording a human/AI demonstration) or DecodeAndSampleActions (if recording from another policy).
- end_recording() None¶
Ends the recording of the observations and actions of each agent and stores them in the current recording object.
- end_recording_and_discard() None¶
Ends the recording of the observations and actions of each agent and discards them.
- get_interactor() LearningAgentsInteractor¶
Get Interactor
- Return type:
- get_recording_asset() LearningAgentsRecording¶
Gets the current recording object. Note: this may be empty until EndRecording has been called.
- Return type:
- classmethod make_recorder(manager, interactor, class_=None, name="Recorder", recorder_path_settings=[["../../../Engine/Intermediate/"], "Recordings"], recording_asset=None, reinitialize_recording=True) -> (LearningAgentsRecorder, manager=LearningAgentsManager, interactor=LearningAgentsInteractor)¶
Constructs this object and runs the setup functions for the underlying data storage. pram: bReinitializeRecording If to reinitialize the recording asset
- Parameters:
manager (LearningAgentsManager) – The agent manager we are using.
interactor (LearningAgentsInteractor) – The agent interactor we are recording with.
name (Name) – The recorder class
recorder_path_settings (LearningAgentsRecorderPathSettings) – The path settings used by the recorder.
recording_asset (LearningAgentsRecording) – Optional recording asset to use. If not provided or bReinitializeRecording is set then a new recording object will be created.
reinitialize_recording (bool)
- Returns:
manager (LearningAgentsManager): The agent manager we are using.
interactor (LearningAgentsInteractor): The agent interactor we are recording with.
- Return type:
tuple
- property on_recording_begin: OnRecordingBeginSignature¶
[Read-Write] Called after the recording has started
- Type:
- property on_recording_end: OnRecordingEndSignature¶
[Read-Write] Called after the recording has stopped
- Type:
- save_schema_config(file_name='schema-config.json') LearningAgentsSchema¶
Saves the schema config JSON to the recording directory with the given filename. Defaults to “schema-config.json”.
- Parameters:
file_name (str)
- Return type:
- setup_recorder(manager, interactor, recorder_path_settings=[["../../../Engine/Intermediate/"], "Recordings"], recording_asset=None, reinitialize_recording=True) -> (manager=LearningAgentsManager, interactor=LearningAgentsInteractor)¶
Initializes this object and runs the setup functions for the underlying data storage. pram: bReinitializeRecording If to reinitialize the recording asset
- Parameters:
manager (LearningAgentsManager) – The agent manager we are using.
interactor (LearningAgentsInteractor) – The agent interactor we are recording with.
recorder_path_settings (LearningAgentsRecorderPathSettings) – The path settings used by the recorder.
recording_asset (LearningAgentsRecording) – Optional recording asset to use. If not provided or bReinitializeRecording is set then a new recording object will be created.
reinitialize_recording (bool)
- Returns:
manager (LearningAgentsManager): The agent manager we are using.
interactor (LearningAgentsInteractor): The agent interactor we are recording with.
- Return type:
tuple