Search Unity

Official [Feedback Wanted] Shipping sample(s) with the ML-Agents C# Package

Discussion in 'ML-Agents' started by christophergoy, Mar 11, 2021.

  1. christophergoy

    christophergoy

    Joined:
    Sep 16, 2015
    Posts:
    735
    Hi all,
    We want to inform you that we will ship the 3DBall example as a Sample in the com.unity.ml-agents C# package at version 1.9.0-preview. We want to ask you which samples you’d like to see included moving forward to understand which example environments our users find most useful.

    We want to note that there are a couple of tradeoffs to having more samples or fewer samples:
    1. The more samples we add to the package, the bigger the size of the package will be. This will impact install and download times when installing ml-agents from the package manager. On the other hand, having more samples means people can access more of what ML-Agents offers without cloning the git repository.

    2. Having a smaller set of samples will reduce download and install times but at the cost of having users need to leave the Unity Editor to explore more of what ML-Agents offers.
    Please help us figure what is important to you as our users by responding to this thread.
    Cheers!
    The ML-Agents Team.
     
    Last edited: Mar 30, 2021
    M_MG_S likes this.
  2. mamaorha

    mamaorha

    Joined:
    Jun 16, 2015
    Posts:
    44
    would be nice to see how you tackle turn based games where agent need to take multiple decisions (number of decisions is dynamicly changed based on situation) in 1 turn and be rewarded based on a full turn.
     
  3. TTrope

    TTrope

    Joined:
    Dec 7, 2014
    Posts:
    20
    I'd say the soccer example could cover tons of different uses cases (basic if only one player + goal, self play, coop, etc). However I would not like the samples to add some tags in my project, or have too many assets.
     
    shivani_1 likes this.
  4. Luke-Houlihan

    Luke-Houlihan

    Joined:
    Jun 26, 2007
    Posts:
    303
    Our use of
    ml-agents
    is heavily automated and pulls down the package fresh for every ephemeral training run. My opinion here is biased toward the package being as small as possible but I understand the want/need to keep it easy to use for beginners.

    Is there any way there could be 2 packages? Something like
    ml-agents
    , which contains a few examples and
    ml-agents-lite
    which has only the core necessities?
     
    Last edited: Mar 30, 2021
    AngrySamsquanch likes this.
  5. christophergoy

    christophergoy

    Joined:
    Sep 16, 2015
    Posts:
    735
    Hey @Luke-Houlihan, I understand your concern over package size. Where are you "pulling the package down" from?
     
  6. Luke-Houlihan

    Luke-Houlihan

    Joined:
    Jun 26, 2007
    Posts:
    303
    The default pip repo, PyPi. I suppose I could cache the latest locally and strip the examples but that kind of defeats the purpose.
     
  7. christophergoy

    christophergoy

    Joined:
    Sep 16, 2015
    Posts:
    735
    The samples wouldn't live in PyPi, they would live in the C# package. Sorry if that wasn't clear. I can update the text of the thread
     
  8. Luke-Houlihan

    Luke-Houlihan

    Joined:
    Jun 26, 2007
    Posts:
    303
    Ohh! My bad, I misunderstood that :eek:. Thanks for the clarification!
     
  9. AlainGao

    AlainGao

    Joined:
    Mar 27, 2020
    Posts:
    1
    Hello, I have some request about ML-Agents.
    1. I want to set Behavior Parameters dynamic, so that I can switch mode in running.
    2. Could you add interface to get necessary information from sensors? I want to read RayPerceptionOutput.RayOutput from RayPerceptionSensorComponent2D so that I can dynamic programing, but I found there is no interface.
     
    Atilli likes this.
  10. GamerLordMat

    GamerLordMat

    Joined:
    Oct 10, 2019
    Posts:
    185
    Maybe I am just incompetent but I needed like 30 minutes to find the examples on the github site.
    Some kind of quick access over the package manager would be cool, IMO.
    Otherwise bc of Cloud ports and similar applications I personally would minimize the amount of examples in the standard mlagents. I have one Unity Project opened with all the examples; that works just fine for me.

    What I personally also miss is some kind of tutorial which elobarates the implementation details a little bit of the examples. E.g. I still have no clue how exactly the joint forces work in the walker example.

    Otherwise thanks for your work on mlagents, it makes so much fun and motivated me to start learning about Deep Neural Networks ;D
     
    BackgroundMover likes this.
  11. ChillX

    ChillX

    Joined:
    Jun 16, 2016
    Posts:
    145
    1. 3D Ball - (Simplest example)
    2. Soccer - (Covers many use cases especially competitive and self play)
    3. Push Block Plus the Collab version (Covers Collab with POCA)
    4. Pyramids or DungeonEscape (Covers Sparse rewards and curiosity very well)

    Each one covers a different use case.
    Honestly though I would almost include them all if that's an option. Each one covers a completely different use case.
     
    Last edited: Mar 16, 2022
  12. hughperkins

    hughperkins

    Joined:
    Dec 3, 2022
    Posts:
    191
    I concur with those suggesting moving the examples to a different repo.

    I suppose the main issue you are concerned about is that the versions need to match? But that's not I feel an insurmountable issue. e.g. specify very clearly somewhere which version, or branch, or git commit hash we should run against when using that example at that commit. eg

    mlagents-examples repo:
    - commit abweew
    --- README.md Please use mlagents `release_20`
    - commit wewrgrg
    --- README.md Please use mlagents `release_20`
    - commit sdewfg
    --- README.md Please use mlagents `release_19`
    ...
     
  13. hughperkins

    hughperkins

    Joined:
    Dec 3, 2022
    Posts:
    191
    (I suppose one other issue you guys are considering, that you aren't actually stating, is that maintaining tons of environments increases the cost of maintenance, and reduces agility of the overall code-base?)
     
  14. maxkcy

    maxkcy

    Joined:
    Oct 11, 2021
    Posts:
    62
    Ml-agents is excellent, but where can I find a dedicated server for a good price to train?
    It also causes my computer to freeze on mlagent gameobject activation and decision request. So some tutorials with ml-agents dots.
     
    Last edited: Apr 28, 2023
  15. maxkcy

    maxkcy

    Joined:
    Oct 11, 2021
    Posts:
    62
    I was able to set up training on an AWS instance, at 80 cents an hour it costs $20 a day and I was only able to achieve 3 million training steps in a day. Which was def not worth the effort in the end to set it up, and money spent running it for a few days. I felt there might have been configuration issues because it didn't feel like I was making full use of the GPU, but I highly doubt that.

    Moreover, still need the DOTS solution for ML-agents, or something that is faster. Every time the ai makes a decision, it paralyses the computer.