Search Unity

It's unclear from the docs how to set up a curriculum with multiple parameters

Discussion in 'ML-Agents' started by crlycstl, Sep 23, 2020.

  1. crlycstl

    crlycstl

    Joined:
    Mar 19, 2016
    Posts:
    2
    The docs show an example for only one environment parameter and it's not obvious how to work with multiple at a time. Are you supposed to set up multiple parameters, each with their own curriculum/lessons?

    The goal would be to change more than one parameter at a time in a given lesson.
     
  2. Luke-Houlihan

    Luke-Houlihan

    Joined:
    Jun 26, 2007
    Posts:
    303
    I assume the doc you're referring to is this one.

    Yes your assumption is correct, the
    environment_parameters:
    section can contain multiple parameters each with their own custom curriculum.

    Something like this -
    Code (CSharp):
    1. behaviors:
    2.   BehaviorY:
    3.     # < Same as above >
    4.  
    5. # Add this section
    6. environment_parameters:
    7.   my_environment_parameter:
    8.     curriculum:
    9.       - name: MyFirstLesson # The '-' is important as this is a list
    10.         completion_criteria:
    11.           measure: progress
    12.           behavior: my_behavior
    13.           signal_smoothing: true
    14.           min_lesson_length: 100
    15.           threshold: 0.2
    16.         value: 0.0
    17.       - name: MySecondLesson # This is the start of the second lesson
    18.         completion_criteria:
    19.           measure: progress
    20.           behavior: my_behavior
    21.           signal_smoothing: true
    22.           min_lesson_length: 100
    23.           threshold: 0.6
    24.           require_reset: true
    25.         value:
    26.           sampler_type: uniform
    27.           sampler_parameters:
    28.             min_value: 4.0
    29.             max_value: 7.0
    30.       - name: MyLastLesson
    31.         value: 8.0
    32.  
    33.   second_parameter:
    34.     sampler_type: uniform
    35.     sampler_parameters:
    36.         min_value: 0.5
    37.         max_value: 10
    38.  
    39.   third:
    40.     curriculum:
    41.       - name: Lesson1 # The '-' is important as this is a list
    42.         completion_criteria:
    43.           measure: progress
    44.           behavior: my_behavior
    45.           signal_smoothing: true
    46.           min_lesson_length: 100
    47.           threshold: 0.2
    48.         value: 0.0
    49.       - name: Lesson2 # This is the start of the second lesson
    50.         completion_criteria:
    51.           measure: progress
    52.           behavior: my_behavior
    53.           signal_smoothing: true
    54.           min_lesson_length: 100
    55.           threshold: 0.6
    56.           require_reset: true
    57.         value:
    58.           sampler_type: uniform
    59.           sampler_parameters:
    60.             min_value: 4.0
    61.             max_value: 7.0
    62.       - name: FinalLesson
    63.         value: 8.0
     
    smhehill, crlycstl and ruoping_unity like this.
  3. crlycstl

    crlycstl

    Joined:
    Mar 19, 2016
    Posts:
    2
    Ah ok, so since in my particular case I want to have multiple parameters effectively part of the same lesson, I'll just duplicate the lesson settings.

    Thank you much for the help!!
     
  4. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    How does the "threshold, signal_smoothing, min_lesson_length" work for multiple parameters? Which one gets used if the values are different and Lesson 0 has these duplicated several times (for different parameters) with different values?
     
  5. Luke-Houlihan

    Luke-Houlihan

    Joined:
    Jun 26, 2007
    Posts:
    303
    All of them get used. Each parameter has its own curriculum that is run independently of other parameters. In my example those values are copy-pasted and are the same but in a real implementation they could be set to a different value that makes the most sense for that particular environment parameter.
     
    Phong likes this.
  6. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Thanks for the clarification. I do agree that the docs could be improved. After reading them I had made the faulty assumptions that the lessons for all the parameters advanced in lockstep. When one parameter advanced to the next lesson then they all would.
     
  7. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,820
    Hey there! Thanks for the feedback. If you have a chance, could you fill out the Documentation Feedback form, which can be found at the bottom of every documentation page - both in the core platform docs & in package docs. This allows us to collate all feedback about a specific page in the same place, and act on all of it at once.
     
    twobob likes this.
  8. Phong

    Phong

    Joined:
    Apr 12, 2010
    Posts:
    2,085
    Hi TreyK-47, thanks for the comment.

    Is there documentation for ML-Agents in the official docs yet? When I search all the docs are on the github site. I don't see a preview link there. What is the best way to submit feedback on those docs. Submit an issue?