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="./download: string[]s"
- Notebooks
- Google Colab
- Kaggle
| using NUnit.Framework; | |
| using Unity.MLAgents.Sensors; | |
| namespace Unity.MLAgents.Tests | |
| { | |
| [] | |
| public class ObservationSpecTests | |
| { | |
| [] | |
| public void TestVectorObsSpec() | |
| { | |
| var obsSpec = ObservationSpec.Vector(5); | |
| Assert.AreEqual(1, obsSpec.Rank); | |
| var shape = obsSpec.Shape; | |
| Assert.AreEqual(1, shape.Length); | |
| Assert.AreEqual(5, shape[0]); | |
| var dimensionProps = obsSpec.DimensionProperties; | |
| Assert.AreEqual(1, dimensionProps.Length); | |
| Assert.AreEqual(DimensionProperty.None, dimensionProps[0]); | |
| Assert.AreEqual(ObservationType.Default, obsSpec.ObservationType); | |
| } | |
| [] | |
| public void TestVariableLengthObsSpec() | |
| { | |
| var obsSpec = ObservationSpec.VariableLength(5, 6); | |
| Assert.AreEqual(2, obsSpec.Rank); | |
| var shape = obsSpec.Shape; | |
| Assert.AreEqual(2, shape.Length); | |
| Assert.AreEqual(5, shape[0]); | |
| Assert.AreEqual(6, shape[1]); | |
| var dimensionProps = obsSpec.DimensionProperties; | |
| Assert.AreEqual(2, dimensionProps.Length); | |
| Assert.AreEqual(DimensionProperty.VariableSize, dimensionProps[0]); | |
| Assert.AreEqual(DimensionProperty.None, dimensionProps[1]); | |
| Assert.AreEqual(ObservationType.Default, obsSpec.ObservationType); | |
| } | |
| [] | |
| public void TestVisualObsSpec() | |
| { | |
| var obsSpec = ObservationSpec.Visual(5, 6, 7); | |
| Assert.AreEqual(3, obsSpec.Rank); | |
| var shape = obsSpec.Shape; | |
| Assert.AreEqual(3, shape.Length); | |
| Assert.AreEqual(5, shape[0]); | |
| Assert.AreEqual(6, shape[1]); | |
| Assert.AreEqual(7, shape[2]); | |
| var dimensionProps = obsSpec.DimensionProperties; | |
| Assert.AreEqual(3, dimensionProps.Length); | |
| Assert.AreEqual(DimensionProperty.TranslationalEquivariance, dimensionProps[0]); | |
| Assert.AreEqual(DimensionProperty.TranslationalEquivariance, dimensionProps[1]); | |
| Assert.AreEqual(DimensionProperty.None, dimensionProps[2]); | |
| Assert.AreEqual(ObservationType.Default, obsSpec.ObservationType); | |
| } | |
| [] | |
| public void TestMismatchShapeDimensionPropThrows() | |
| { | |
| var shape = new InplaceArray<int>(1, 2); | |
| var dimProps = new InplaceArray<DimensionProperty>(DimensionProperty.TranslationalEquivariance); | |
| Assert.Throws<UnityAgentsException>(() => new ObservationSpec(shape, dimProps)); | |
| } | |
| } | |
| } | |