Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Does ML-Agents have an API for interprocess communication?

Discussion in 'ML-Agents' started by unity_95E2298061EFD837527E, May 18, 2023.

  1. unity_95E2298061EFD837527E

    unity_95E2298061EFD837527E

    Joined:
    Feb 10, 2023
    Posts:
    11
    Suppose my model to be trained is in Python, and I have a simulation in Unity, and I wish to use ML-Agents to train it. Will the command "mlagnets-learn" include the required training data from Unity to be sent to the model in Python automatically? Or do I need to do this some other way like using some socket connections etc?
     
  2. bahaagh7

    bahaagh7

    Joined:
    Aug 29, 2019
    Posts:
    6
    If by "training data from Unity" you are referring to observations and rewards, then yes, Unity will automatically send the observations and rewards for each step and receive the actions through the Python API. All you need to do is run the command "mlagents-learn" and provide the path to the config file, along with specifying a training ID. For example:
    Code (CSharp):
    1. mlagents-learn /Users/username/GameProject/config/AgentPPO.yaml --run-id=Training1
    Hope I answered your question.