浏览代码

tennis curriculum

/asymm-envs
Andrew Cohen 5 年前
当前提交
9fed4985
共有 3 个文件被更改,包括 29 次插入10 次删除
  1. 12
      Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs
  2. 20
      config/trainer_config.yaml
  3. 7
      config/curricula/tennis.yaml

12
Project/Assets/ML-Agents/Examples/Tennis/Scripts/TennisAgent.cs


public GameObject myArea;
public float angle;
public float scale;
float m_BallTouch;
Text m_TextComponent;
Rigidbody m_AgentRb;

return action;
}
void OnCollisionEnter(Collision c)
{
if (c.gameObject.CompareTag("ball"))
{
// 8f is for offset of ball to area
AddReward(.05f * m_BallTouch * (8f + ball.transform.position.y - myArea.transform.position.y));
}
}
m_BallTouch = Academy.Instance.FloatProperties.GetPropertyWithDefault("ball_touch", 0);
m_InvertMult = invertX ? -1f : 1f;
transform.position = new Vector3(-m_InvertMult * Random.Range(6f, 8f), -1.5f, -1.8f) + transform.parent.transform.position;

20
config/trainer_config.yaml


time_horizon: 1000
self_play:
window: 10
play_against_latest_model_ratio: 0.2
play_against_latest_model_ratio: 0.5
save_steps: 50000
swap_steps: 50000
team_change: 100000

max_steps: 5.0e7
max_steps: 3.0e7
learning_rate_schedule: constant
batch_size: 2048
buffer_size: 20480

self_play:
window: 100
play_against_latest_model_ratio: 0.2
window: 50
play_against_latest_model_ratio: 0.5
save_steps: 50000
swap_steps: 25000
team_change: 200000

max_steps: 5.0e7
max_steps: 3.0e7
learning_rate_schedule: constant
batch_size: 2048
buffer_size: 20480

self_play:
window: 100
play_against_latest_model_ratio: 0.2
window: 50
play_against_latest_model_ratio: 0.5
save_steps: 50000
swap_steps: 100000
team_change: 200000

max_steps: 3.0e7
max_steps: 5.0e7
learning_rate_schedule: constant
batch_size: 2048
buffer_size: 20480

self_play:
window: 100
play_against_latest_model_ratio: 0.2
window: 50
play_against_latest_model_ratio: 0.5
save_steps: 50000
swap_steps: 50000
team_change: 200000

7
config/curricula/tennis.yaml


Tennis:
measure: progress
thresholds: [0.05, 0.1]
min_lesson_length: 100
signal_smoothing: true
parameters:
ball_touch: [1.0, 0.5, 0.0]
正在加载...
取消
保存