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 System; | |
| using System.Collections.Generic; | |
| using NUnit.Framework; | |
| using Unity.MLAgents.Sensors; | |
| using Unity.MLAgents.Actuators; | |
| using Unity.MLAgents.Analytics; | |
| using Unity.MLAgents.Policies; | |
| using UnityEditor; | |
| namespace Unity.MLAgents.Tests.Analytics | |
| { | |
| [] | |
| public class TrainingAnalyticsTests | |
| { | |
| [] | |
| [] | |
| [] | |
| public string TestParseBehaviorName(string fullyQualifiedBehaviorName) | |
| { | |
| return TrainingAnalytics.ParseBehaviorName(fullyQualifiedBehaviorName); | |
| } | |
| [] | |
| public void TestRemotePolicyEvent() | |
| { | |
| var behaviorName = "testBehavior"; | |
| var sensor1 = new Test3DSensor("SensorA", 21, 20, 3); | |
| var sensor2 = new Test3DSensor("SensorB", 20, 22, 3); | |
| var sensors = new List<ISensor> { sensor1, sensor2 }; | |
| var actionSpec = ActionSpec.MakeContinuous(2); | |
| var vectorActuator = new VectorActuator(null, actionSpec, "test'"); | |
| var actuators = new IActuator[] { vectorActuator }; | |
| var remotePolicyEvent = TrainingAnalytics.GetEventForRemotePolicy(behaviorName, sensors, actionSpec, actuators); | |
| // The behavior name should be hashed, not pass-through. | |
| Assert.AreNotEqual(behaviorName, remotePolicyEvent.BehaviorName); | |
| Assert.AreEqual(2, remotePolicyEvent.ObservationSpecs.Count); | |
| Assert.AreEqual(3, remotePolicyEvent.ObservationSpecs[0].DimensionInfos.Length); | |
| Assert.AreEqual(20, remotePolicyEvent.ObservationSpecs[0].DimensionInfos[0].Size); | |
| Assert.AreEqual(0, remotePolicyEvent.ObservationSpecs[0].ObservationType); | |
| Assert.AreEqual("None", remotePolicyEvent.ObservationSpecs[0].CompressionType); | |
| Assert.AreEqual(Test3DSensor.k_BuiltInSensorType, remotePolicyEvent.ObservationSpecs[0].BuiltInSensorType); | |
| Assert.AreEqual(2, remotePolicyEvent.ActionSpec.NumContinuousActions); | |
| Assert.AreEqual(0, remotePolicyEvent.ActionSpec.NumDiscreteActions); | |
| Assert.AreEqual(2, remotePolicyEvent.ActuatorInfos[0].NumContinuousActions); | |
| Assert.AreEqual(0, remotePolicyEvent.ActuatorInfos[0].NumDiscreteActions); | |
| } | |
| [] | |
| public void TestRemotePolicy() | |
| { | |
| if (Academy.IsInitialized) | |
| { | |
| Academy.Instance.Dispose(); | |
| } | |
| using (new AnalyticsUtils.DisableAnalyticsSending()) | |
| { | |
| var actionSpec = ActionSpec.MakeContinuous(3); | |
| var policy = new RemotePolicy(actionSpec, Array.Empty<IActuator>(), "TestBehavior?team=42"); | |
| policy.RequestDecision(new AgentInfo(), new List<ISensor>()); | |
| } | |
| Academy.Instance.Dispose(); | |
| } | |
| [] | |
| [] | |
| [] | |
| public string TestTrainingBehaviorInitialized(string stringToMaybeHash) | |
| { | |
| var tbiEvent = new TrainingBehaviorInitializedEvent(); | |
| tbiEvent.BehaviorName = stringToMaybeHash; | |
| tbiEvent.Config = "{}"; | |
| var sanitizedEvent = TrainingAnalytics.SanitizeTrainingBehaviorInitializedEvent(tbiEvent); | |
| return sanitizedEvent.BehaviorName; | |
| } | |
| [] | |
| public void TestEnableAnalytics() | |
| { | |
| Assert.IsTrue(EditorAnalytics.enabled == TrainingAnalytics.EnableAnalytics()); | |
| Assert.IsFalse(TrainingAnalytics.EnableAnalytics()); | |
| } | |
| } | |
| } | |