Search Unity

How to split my NN in two

Discussion in 'ML-Agents' started by mmmbop, Aug 24, 2022.

  1. mmmbop

    mmmbop

    Joined:
    Jan 22, 2022
    Posts:
    20
    Hello, how correctly to split NN in several parts?
    I mean, for example, i train my agent for walking ( humanoid example), for he got problem with rotates, so i think i need somehow to divide my nn in 2 : one for walking towards and second for rotate to target, but how to implement this? Or its better to do it in one NN , but algorithm seems to be diffucult for one NN, its too many "IF"'s there, if taget is changed, not move,just arond this axis etc...
    Is there some example how to divide my behavoir and switch between them by condition?
     
  2. WaxyMcRivers

    WaxyMcRivers

    Joined:
    May 9, 2016
    Posts:
    59
    The problem should be easy enough for a single NN to handle, it's usually about the data, not the NN.

    There are multiple examples in the ML agents package that you can look at for standard locomotion tasks. There are some pre-built components that are nice to use that will provide useful info to your agent, making the task easier. The food collector example could be a good place to start for simple locomotion based task.

    I definitely recommend newcomers to spend a decent amount of time working through the code, components, and scenes that the mlagents team spent time putting together. They are a good ground truth to reference when preparing to work on your own custom projects.