Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to write a curriculum for UnityML

Discussion in 'ML-Agents' started by Laurens92, May 5, 2023.

  1. Laurens92

    Laurens92

    Joined:
    Apr 15, 2021
    Posts:
    1
    I've been trying for days to workout how to write a curriculum for the trainer file for UnityML. However, I keep getting this error: mlagents.trainers.exception.TrainerConfigError: The option curriculum was specified in your YAML file for TrainerSettings, but is invalid.

    Does anyone know how to use and implement the curriculum for the trainer file?



    Here is the trainer file that I created and the curriculum (in a external file):

    behaviors:

    Hummingbird:

    trainer_type: ppo

    curriculum: curriculum.json

    hyperparameters:

    batch_size: 1024

    buffer_size: 10240

    learning_rate: 0.0005

    beta: 0.001

    epsilon: 0.1

    lambd: 0.9

    num_epoch: 5

    learning_rate_schedule: constant

    network_settings:

    normalize: true

    hidden_units: 128

    num_layers: 3

    vis_encode_type: simple

    reward_signals:

    extrinsic:

    gamma: 0.95

    strength: 1.0

    keep_checkpoints: 5

    checkpoint_interval: 500000

    max_steps: 5000000

    time_horizon: 128

    summary_freq: 5000

    threaded: true



    {

    "curriculum": [

    {

    "name": "Lesson1",

    "completion_criteria": {

    "measure": "reward",

    "behavior": "AgentML",

    "threshold": 200,

    "min_lesson_length": 20000

    },

    "parameters": {

    "opponent_distance": 2.5,

    "num_teammates": 1,

    "num_opponent_types": 1

    }

    },

    {

    "name": "Lesson2",

    "completion_criteria": {

    "measure": "reward",

    "behavior": "AgentML",

    "threshold": 400,

    "min_lesson_length": 20000

    },

    "parameters": {

    "opponent_distance": 5.0,

    "num_teammates": 2,

    "num_opponent_types": 2

    }

    },

    {

    "name": "Lesson3",

    "completion_criteria": {

    "measure": "reward",

    "behavior": "AgentML",

    "threshold": 600,

    "min_lesson_length": 20000

    },

    "parameters": {

    "opponent_distance": 7.5,

    "num_teammates": 3,

    "num_opponent_types": 3

    }

    }

    ]

    }