Search Unity

check out my new ML Agent written completly from pytorch to c-sharp

Discussion in 'ML-Agents' started by isawyou0, Nov 3, 2020.

  1. isawyou0

    isawyou0

    Joined:
    Oct 8, 2020
    Posts:
    30
    namuh likes this.
  2. ervteng_unity

    ervteng_unity

    Unity Technologies

    Joined:
    Dec 6, 2018
    Posts:
    150
    This is great work, thanks for sharing!
     
  3. isawyou0

    isawyou0

    Joined:
    Oct 8, 2020
    Posts:
    30
    you're Welcome!
     
  4. Keemo

    Keemo

    Joined:
    Apr 22, 2014
    Posts:
    31
    Hey,

    if i add the files to a Project with ML-Agents installed, I get many "no suitable method found to override" errors.
    Could you give a little guide to Setup the project?

    Greetings
     
  5. isawyou0

    isawyou0

    Joined:
    Oct 8, 2020
    Posts:
    30
    Well this Repo have no relation between ML Agents you can use them both, Just simply Add an Agent Component, and edit propreties, or change reward code via script by respecting the hierarchy of the code. you error come from something else. tell us more info about you're error.
     
  6. isawyou0

    isawyou0

    Joined:
    Oct 8, 2020
    Posts:
    30
    well, I've made updates, I added PPO discrete, now fully functional :) you can test that in the gridworld I've added Q learning too
     
    namuh likes this.
  7. isawyou0

    isawyou0

    Joined:
    Oct 8, 2020
    Posts:
    30
    Ball Balance :)
     

    Attached Files:

  8. MrOCW

    MrOCW

    Joined:
    Feb 16, 2021
    Posts:
    51
  9. spakment

    spakment

    Joined:
    Dec 19, 2017
    Posts:
    96
    This is a great bit of work, I've been playing around with it, and can confirm its learning in a WebGL build no problem, so I'd assume cross compatibility is no problem (Android & IOS compatibility) - something no other machine learning library is currently capable of doing!

    I forked your project and optimised a few Unity specific bits to try and improve performance. (https://github.com/makeplayhappy/Unity-CSharp-ML/)

    I'm getting some big spikes as the ActorNet:Backward runs through the Net, making the batch sizes small does help a little.

    I wonder about changing the multidimensional arrays into jagged ones, as I think the C# compiler may be better able to optimise them, if there are any DOTs programmers reading this, I think this would be an idea candidate for that type of architecture.

    @isawyou_unity
    I'd like to add in some save / load functionality and was wondering if you could point me at your original source material - I have looked through Pytorch but I can't see much similarity between it and the code here - did you work of an old / different branch?
     
  10. namuh

    namuh

    Joined:
    Nov 20, 2016
    Posts:
    23
    Wow man this is stellar work you've done here! Thank you for sharing!
    I only wish I had found this sooner.
    This is definitely on my list of things to test out now.