Unity-Technologies / ml-agents

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.
https://unity.com/products/machine-learning-agents
Other
16.93k stars 4.14k forks source link

Get list of observations -> make m_Observations public get #4634

Closed markste-in closed 3 years ago

markste-in commented 3 years ago

Is your feature request related to a problem? Please describe. I often haven the issue that I want to troubleshoot the learning behaviour by inspecting the observations that I added with sensor.AddObservation in CollectObservations(VectorSensor sensor). Right now I would need to add all observations manually to a list or something else to output / troubleshoot them later on.

Describe the solution you'd like The class VectorSensor in Unity.MLAgents.Sensors has already a list with all observations called: private List<float> m_Observations; It would be nice if we can change the private to a public get. That would give direct access to the observation without the need of handcrafting a workaround. public List<float> m_Observations { get; private set; }

Describe alternatives you've considered None

Additional context Even though the debugger gets you access to everything, it gives you just a snapshot in time and you have to manually click through every "hit" -> not really a solution especially if you have multiple agents

Ihsees commented 3 years ago

Does Agent.GetObservations() help you? Changelog 1.1.0-preview

markste-in commented 3 years ago

ahh yes. Does exactly what I need... I don't know how I missed that.

Thanks!

github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.