Registry Mirror
Skip to content

Reinforcement Learning Capability #1026

Closed

Description

@chunky

Is your feature request related to a problem? Please describe.
I have models at work that are build in C# and VB.NET, that I'm using for reinforcement learning.

Currently I have an unpleasant and nonperformant mechanism for connecting the VB.NET models to python so that I can use openai gym for RL. If I could use modelbuilder/ML.NET for RL, it would improve my life considerably. [The model is ~35k SLOC in VB.NET]

Describe the solution you'd like
Something akin to the current "Limited Scenarios" of anomaly detection, forecasting, clustering.

It would be nice if it largely involved my model implementing an interface something like OpenAI's Gym, and then a basic demonstration of PPO/TRPO/some policy gradient descent/etc in C#, built using ML.NET.

Describe alternatives you've considered
I already have a solution using Python, where I've implemented the OpenAI Gym interface. It opens a pipe onto my model's stdin/stdout, then has to re-parse all the models inputs. I've reimplemented pretty much the entire parsing part of the main model, in Python, and then use Python to build the observation space, because shuttling the entire observation space along a pipe.

The performance of this house of cards is terrible [and in RL, faster performance==more learning]. The observation is relatively slow to create in general; it's expensive to create in VB.NET then shuttle over the pipe; and it's expensive to create in python, where threading isn't an option due to the GIL, and the raw performance of many sin/cos/tan operations is also poor. It's not robust because now I'm trying to maintain two separate codebases that do the same thing [parsing all the inputs and reimplementing small parts of the model].

Additional context
I'm finding ML.NET great for most tasks, but RL is a central task in my daily work, and currently I have to go to python to achieve that. We are also looking at Unity for some projects, and AI in Unity would very clearly be better run using C#+ML.NET.

Activity

  1. beccamc commented on Oct 1, 2020

    @beccamc
    Contributor

    @briacht for visibility

  2. JakeRadMSFT commented on Nov 2, 2020

    @JakeRadMSFT
    Member

    Thanks for the recommendation! We'll investigate what options we have ... Do you have any example code you could share?

    Were you able to find any .NET ways to do RL?

  3. JakeRadMSFT commented on Nov 2, 2020

    @JakeRadMSFT
    Member
  4. chunky commented on Nov 3, 2020

    @chunky
    Author

    I'm afraid all the code I use in this space is off-the-shelf python. The main things I used are openai baselines and Ray RLLib. I was much more focused on developing a useful model to do RL in, than on the RL algorithms themselves.

    By extension, I simply gave up trying to do RL in ML.NET. :-(

  5. johnwc commented on May 31, 2021

    @johnwc

    @JakeRadMSFT @briacht @beccamc Any updates on RL? It seems that this is a bit of popular want/need in ML.net. In our scenario, we are looking to use it to control temperature/humidity in a warehouse by controlling fans, monitoring several temperature/humidity devices inside along with outside temperature/humidity.

  6. added
    Multiple Requests
    on Jun 3, 2021
  7. luisquintanilla commented on Jun 13, 2022

    @luisquintanilla
    Contributor

    Hi @chunky & @johnwc

    Reinforcement learning is currently not part of our roadmap mainly because it's not natively supported in the framework. However, as we hear more from the community we can take a look at this at a later time. In the meantime, there is a project that shows how to use RL models with ML.NET that you might be interested in:

    https://github.com/JimFFM/ml-hackathon-2021/tree/main/Godot_NET-Server/godot_net_server

  8. johnwc commented on Jun 14, 2022

    @johnwc

    Should we open a request for RL in the framework's repo?

  9. luisquintanilla commented on Jun 15, 2022

    @luisquintanilla
    Contributor

    Should we open a request for RL in the framework's repo?

    @johnwc That would be great. Thanks!

  10. luisquintanilla commented on Sep 22, 2022

    @luisquintanilla
    Contributor

    Thanks @johnwc @chunky for the discussion.

    Issue dotnet/machinelearning#181 has been reopened to track feedback. Closing this issue for now since it's currently not possible without framework support in Model Builder / ML.NET CLI.

  11. Viir commented on Sep 22, 2022

    @Viir

    Thank you for the update Luis,

    however, it looks like dotnet/machinelearning#181 is not yet completely reopened, as comments are still disabled there:

    The UI says:

    This conversation has been locked as resolved and limited to collaborators.

    image

  12. luisquintanilla commented on Sep 22, 2022

    @luisquintanilla
    Contributor

    @Viir thanks for the heads up. It should be fixed now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Multiple RequestsReported by: CustomerStale

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions