Goal conditioning grid world : Example of goal conditioning#5193
Conversation
|
|
||
| public override void CollectObservations(VectorSensor sensor) | ||
| { | ||
| Array values = Enum.GetValues(typeof(GridGoal)); |
There was a problem hiding this comment.
Can this happen somewhere else? It feels like abuse of CollectObservations(), since it's not touching the input VectorSensor.
There was a problem hiding this comment.
VectorSensor is null here, I do not see an issue with this. Goal Signal is an observation, so it makes sense to me that it is called in CollectObservation.
Would it be better if I put this logic into a CollectGoal method with no arguments that I call in CollectObservations ?
There was a problem hiding this comment.
CollectGoal is maybe for the example (but let's not add it Agent). Let me think about a better way.
One problem (which I didn't realize until now) is that we don't check for null CollectObservationsSensor during the normal update step:
ml-agents/com.unity.ml-agents/Runtime/Agent.cs
Line 1062 in e4e9c51
but we do check for null when the agent is done:
ml-agents/com.unity.ml-agents/Runtime/Agent.cs
Lines 563 to 571 in e4e9c51
| if (hit.Where(col => col.gameObject.CompareTag("goal")).ToArray().Length == 1) | ||
| { | ||
| SetReward(1f); | ||
| ProvideReward(GridGoal.Plus); |
There was a problem hiding this comment.
This is pretty confusing since the "goal" tag doesn't really mean that it's the goal anymore. Can you change them to e.g. "plus" and "ex"?
Or maybe this would be a good opportunity to stop using physics collision checks, and change the example to use a 2D array of enums? That would probably speed up training too.
There was a problem hiding this comment.
I changed the tags to plus and ex. I think making the grid a 2D array of enums is a good idea, but out of scope for this.
|
(sorry, can't comment inline for the file removal). (and that should have failed the link checker) |
|
|
Might not be related to this PR, but should we add a warning in the docs about using hypernetworks for larger |
There is this line in the documentation: I am hesitant to throw a warning if the model is going to be large because we never know what the user has in mind... |
| @@ -82,16 +82,16 @@ you would like to contribute environments, please see our | |||
|
|
|||
|  | |||
There was a problem hiding this comment.
Possible to link to this environment in the goal signal docs and the Changelog? Just in case a user wants an example of how to use these features
Co-authored-by: Ervin T. <ervin@unity3d.com>
Proposed change(s)
Making GridWorld use the new goal conditioning.
Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
Types of change(s)
Checklist
Other comments