-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate continuous/discrete actions in AgentActionProto #4698
Separate continuous/discrete actions in AgentActionProto #4698
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me except for the python syntax errors around referencing VectorActionsDeprecated before they are assigned.
foreach (var ap in proto.Value) | ||
{ | ||
agentActions.Add(ap.VectorActions.ToArray()); | ||
agentActions.Add(new ActionBuffers(ap.ContinuousActions.ToArray(), ap.DiscreteActions.ToArray())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite sure what type ap
is here, but can we add a ToActionBuffers() extension method to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is auto-generated AgentActionProto
class so maybe not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extension method == "this" modifier in argument, so something like
public static ActionBuffers ToActionBuffers(this UnityRLInputProto.Types.AgentActionProto proto)
{
return new ActionBuffers(proto.ContinuousActions.ToArray(), proto.DiscreteActions.ToArray());
}
...
agentActions.Add(ap.ToActionBuffers());
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a big deal but it's just a bit cleaner
} | ||
|
||
public void CopyActions(ActionBuffers actionBuffers) | ||
{ | ||
actionBuffers.PackActions(storedVectorActions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we use PackActions anywhere else? If not, can we remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
Can you point out where the syntax errors are? I didn't see python syntax issues around VectorActionsDeprecated |
around line 586 in the execution log. |
* separate entries for continuous/discrete in action proto * store actions in AgentInfo as ActionBuffers instead of arrays
* Add hybrid action capability flag (#4576) * Change BrainParametersProto to support ActionSpec (#4579) * Assign new BrainParametersProto fields based on capabilities (#4581) * ActionBuffer with hybrid actions for RemotePolicy (#4592) * Barracuda inference for hybrid actions (#4611) * Refactor BarracudaModel loader checks (#4629) * Export separate nodes for continuous/discrete actions (#4655) * Separate continuous/discrete actions in AgentActionProto (#4698) * Force different nodes for new and deprecated action output (#4705)
Proposed change(s)
vector_actions
as deprecated but still keep it for backward compatibility.storedVectorActions
from arrays to ActionBuffers to store hybrid actions in AgentInfoUseful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
JIRA: MLA-1593
Types of change(s)
Checklist
Other comments