Class DemonstrationRecorder
The Demonstration Recorder component facilitates the recording of demonstrations used for imitation learning.
Namespace: Unity.MLAgents.Demonstrations
Syntax
public class DemonstrationRecorder : MonoBehaviour
Remarks
Add this component to the GameObject containing an Agent to enable recording the agent for imitation learning. You must implement the Heuristic(Single[]) function of the agent to provide manual control in order to record demonstrations.
See Imitation Learning - Recording Demonstrations for more information.
Fields
DemonstrationDirectory
Directory to save the demo files. Will default to a "Demonstrations/" folder in the Application data path if not specified.
Declaration
public string DemonstrationDirectory
Field Value
Type | Description |
---|---|
String |
DemonstrationName
Base demonstration file name. If multiple files are saved, the additional filenames will have a sequence of unique numbers appended.
Declaration
public string DemonstrationName
Field Value
Type | Description |
---|---|
String |
Record
Whether or not to record demonstrations.
Declaration
public bool Record
Field Value
Type | Description |
---|---|
Boolean |
Methods
AddDemonstrationWriterToAgent(DemonstrationWriter)
Add additional DemonstrationWriter to the Agent. It is still up to the user to Close this DemonstrationWriters when recording is done.
Declaration
public void AddDemonstrationWriterToAgent(DemonstrationWriter demoWriter)
Parameters
Type | Name | Description |
---|---|---|
DemonstrationWriter | demoWriter |
Close()
Close the DemonstrationWriter and remove it from the Agent. Has no effect if the DemonstrationWriter is already closed (or wasn't opened)
Declaration
public void Close()
RemoveDemonstrationWriterFromAgent(DemonstrationWriter)
Remove additional DemonstrationWriter to the Agent. It is still up to the user to Close this DemonstrationWriters when recording is done.
Declaration
public void RemoveDemonstrationWriterFromAgent(DemonstrationWriter demoWriter)
Parameters
Type | Name | Description |
---|---|---|
DemonstrationWriter | demoWriter |