Reinforcement Learning
ml-agents
TensorBoard
ONNX
Pyramids
deep-reinforcement-learning
ML-Agents-Pyramids
Instructions to use AnnaMats/ppo-Pyramids-Training with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ml-agents
How to use AnnaMats/ppo-Pyramids-Training with ml-agents:
mlagents-load-from-hf --repo-id="AnnaMats/ppo-Pyramids-Training" --local-dir="./downloads"
- Notebooks
- Google Colab
- Kaggle
Download com.unity.ml-agents/Runtime/Sensors/BufferSensorComponent.cs from AnnaMats/ppo-Pyramids-Training: direct link, hf CLI and curl.
- Browser
- Download file 2.36 kB
-
https://huggingface.co/AnnaMats/ppo-Pyramids-Training/resolve/main/com.unity.ml-agents/Runtime/Sensors/BufferSensorComponent.cs
- Command line
-
hf download hf://AnnaMats/ppo-Pyramids-Training/com.unity.ml-agents/Runtime/Sensors/BufferSensorComponent.cs
-
curl -L -o BufferSensorComponent.cs https://huggingface.co/AnnaMats/ppo-Pyramids-Training/resolve/main/com.unity.ml-agents/Runtime/Sensors/BufferSensorComponent.cs
2.36 kB
| using UnityEngine; | |
| namespace Unity.MLAgents.Sensors | |
| { | |
| /// <summary> | |
| /// A SensorComponent that creates a <see cref="BufferSensor"/>. | |
| /// </summary> | |
| [] | |
| public class BufferSensorComponent : SensorComponent | |
| { | |
| /// <summary> | |
| /// Name of the generated <see cref="BufferSensor"/> object. | |
| /// Note that changing this at runtime does not affect how the Agent sorts the sensors. | |
| /// </summary> | |
| public string SensorName | |
| { | |
| get { return m_SensorName; } | |
| set { m_SensorName = value; } | |
| } | |
| [] | |
| private string m_SensorName = "BufferSensor"; | |
| /// <summary> | |
| /// This is how many floats each entities will be represented with. This number | |
| /// is fixed and all entities must have the same representation. | |
| /// </summary> | |
| public int ObservableSize | |
| { | |
| get { return m_ObservableSize; } | |
| set { m_ObservableSize = value; } | |
| } | |
| [] | |
| private int m_ObservableSize; | |
| /// <summary> | |
| /// This is the maximum number of entities the `BufferSensor` will be able to | |
| /// collect. | |
| /// </summary> | |
| public int MaxNumObservables | |
| { | |
| get { return m_MaxNumObservables; } | |
| set { m_MaxNumObservables = value; } | |
| } | |
| [] | |
| private int m_MaxNumObservables; | |
| private BufferSensor m_Sensor; | |
| /// <inheritdoc/> | |
| public override ISensor[] CreateSensors() | |
| { | |
| m_Sensor = new BufferSensor(MaxNumObservables, ObservableSize, m_SensorName); | |
| return new ISensor[] { m_Sensor }; | |
| } | |
| /// <summary> | |
| /// Appends an observation to the buffer. If the buffer is full (maximum number | |
| /// of observation is reached) the observation will be ignored. the length of | |
| /// the provided observation array must be equal to the observation size of | |
| /// the buffer sensor. | |
| /// </summary> | |
| /// <param name="obs"> The float array observation</param> | |
| public void AppendObservation(float[] obs) | |
| { | |
| m_Sensor.AppendObservation(obs); | |
| } | |
| } | |
| } | |