Skip to content
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

Can one Agent have two different BehaviorParameters compenents ? #6116

Closed
lyy0095 opened this issue May 20, 2024 · 2 comments
Closed

Can one Agent have two different BehaviorParameters compenents ? #6116

lyy0095 opened this issue May 20, 2024 · 2 comments
Labels
bug Issue describes a potential bug in ml-agents.

Comments

@lyy0095
Copy link

lyy0095 commented May 20, 2024

Hello,
I was training a simple environment for the driving and operating of the excavator Agent.
Excavators have their unique characteristics, that is, they must first move to the appropriate position before using the robotic arms for dig operations. So, the training can be divided into two NNModels, one for drive and the other for arms.
Considering the observations and actions are different for the Agent, I added two different BehaviorParameters compenents to the Agent, but I found no solutions/functions to switch between the two BehaviorParameters compenents during training?

SetModel function as following is only to replace, not to switch:
SetModel("train_driveNet", driveNet);
SetModel("train_operationNet", operationNet);

How can I switch between the two BehaviorParameters compenents during training?
Thank you for the response!

@lyy0095 lyy0095 added the bug Issue describes a potential bug in ml-agents. label May 20, 2024
@lyy0095
Copy link
Author

lyy0095 commented May 20, 2024

Moreover, I checked the example Wall Jump scene.
The Agent of Wall Jump can train two different NNModels by SetModel function in one BehaviorParameters when the dimensions of observations and actions are the same, respectively.
If the dimensions of observations and actions are different in two NNModels, Is there any feasible example code available?

@lyy0095
Copy link
Author

lyy0095 commented Jun 11, 2024

After many tests, the proper answers will be as following:

  1. One Agent can have many BehaviorParameters compenents, but only the first BehaviorParameters can have effects, for the code in Agent.cs line 950 is “m_PolicyFactory = GetComponent< BehaviorParameters >();”.
  2. If you want to train two different NNModels for one Agent, train them as https://github.com/mbaske/robot-ants .

@lyy0095 lyy0095 closed this as completed Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue describes a potential bug in ml-agents.
Projects
None yet
Development

No branches or pull requests

1 participant