Code Monkey home page Code Monkey logo

marwi.unity.mlagents.utils's Introduction

ML Agents Helper

This package aims to make development with ML-Agents quicker and easier.

Features:

  • Setup Training Configurations from Unity Project Settings
  • Start, Stop, Continue Training from Unity Editor
  • Easily copy trained Brains into your Project
  • Set "Control" Parameter on Build-Time for Trainings Scenes
  • Automatically Update Vector Observations during Development

Content

ML-Agents Settings Window

  • Active: If true this configuration will be used for training in ML-Agents-Training Window
  • Name: well...
  • Run ID*: the run-id parameter
  • ML-Agents Dir Rel*: Relative Path to your project to ML-Agents root directory
  • Config Rel*: Relative Path from ML-Agents root to the yaml configuration file used for training
  • Brain Names*: Local Asset Paths to the Brains to be trained, separated by ";" (multi-brain training is not tested yet)
  • Executable Rel: (optional) Relative Path to the executable used for training, if none defined or not found training will run in the editor
  • Anaconda Env: (optional) Name of your anaconda environment that will activate for training
  • Curriculum: (optional) Assign a Curriculum Asset (Create/marwi/ML-Agents/Curriculum) to be used for training. The JSON will be generated when you start training from the Editor and in "curricula//<name_of_brain>.json" (currently only one brain is supported, it uses the first found)

Detect Problems Button:

  • Checks if json files in curriculum directory (if defined) match any Brain in your project
  • Checks if added brains are LearningBrains (and exist)

Currrent Training Process ID: When starting traing from Training Window the Process ID is stored. This ID is used to find the previously started trainings process when UnityEditor recompiles scripts (e.g. when you work on your code while training)

ML-Agents Training Window

Use this window to Start, Stop or Continue Training.

Copy Current Brain lets you copy the previously trained brain OR (if clicked during training) will temporarily Stop the training, copy the saved brain in your project and then resume training.

Automatically Update Vector Observations

Import the "Training Editor Preprocessors" Samples from Unity Package Manager into your project. Then add the "Auto Update Observation" Script to any (or possibly all) of your Agents in your Training Scene. The script checks during ScriptReload (when writing Agent Code) all of your marked Agent's brains get updated. Internally it calls "InitializeAgent" and then "CollectVectorObservations" so make sure your Agent references are all set during Edit-Time.

Training Scene Marker

Add this script to any GameObject in your scene to Automatically set your Academy "Control" to true when building

Multi Agent Training Environment Marker

Add this script to any GameObject in your scene to automatically create multiple copy of your training environment when building

Auto Update Parameters

When using Curriculum Learning this script automatically updates parameter names and lesson-0 values to your Academy when building

Limitations

  • Windows only so far, not tested on MacOS or Linux (feel free to though, I'm happy to fix/help make it work)
  • multi brain training is not tested yet
  • visual observations are not tested/auto update is not implemented
  • imitation learning is not supported yet
  • video recorder is not supported yet
  • some training parameters are not yet exposed/supported (e.g. help, docker, keep-checkpoints, lesson, no-graphics, num-runs, save-frequency, seed, slow, worker-id)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.