浏览代码

push block more steps

/develop/bisim-sac-transfer
yanchaosun 4 年前
当前提交
7dac3284
共有 4 个文件被更改,包括 17 次插入11 次删除
  1. 10
      Project/Assets/ML-Agents/Examples/Reacher/Scripts/NewReacherAgent.cs
  2. 10
      Project/Assets/ML-Agents/Examples/Reacher/Scripts/ReacherAgent.cs
  3. 6
      config/sac_transfer/PushBlock.yaml
  4. 2
      config/sac_transfer/PushBlockTransfer.yaml

10
Project/Assets/ML-Agents/Examples/Reacher/Scripts/NewReacherAgent.cs


var torqueX = Mathf.Clamp(vectorAction[0], -1f, 1f) * 150f;
var torqueZ = Mathf.Clamp(vectorAction[1], -1f, 1f) * 150f;
m_RbA.AddTorque(new Vector3(torqueX, 0f, torqueZ));
AddReward( - (0.05f * torqueX * torqueX + 0.05f * torqueZ * torqueZ));
AddReward( - (0.05f * torqueX * torqueX + 0.05f * torqueZ * torqueZ));
AddReward( - 0.005f * (vectorAction[0] * vectorAction[0]
+ vectorAction[1] * vectorAction[1]
+ vectorAction[2] * vectorAction[2]
+ vectorAction[3] * vectorAction[3]
));
}
/// <summary>

10
Project/Assets/ML-Agents/Examples/Reacher/Scripts/ReacherAgent.cs


sensor.AddObservation(goal.transform.localPosition);
sensor.AddObservation(hand.transform.localPosition);
sensor.AddObservation(m_GoalSpeed);
}

var torqueZ = Mathf.Clamp(vectorAction[1], -1f, 1f) * 150f;
m_RbA.AddTorque(new Vector3(torqueX, 0f, torqueZ));
AddReward( - (0.05f * torqueX * torqueX + 0.05f * torqueZ * torqueZ));
AddReward( - (0.05f * torqueX * torqueX + 0.05f * torqueZ * torqueZ));
AddReward( - 0.005f * (vectorAction[0] * vectorAction[0]
+ vectorAction[1] * vectorAction[1]
+ vectorAction[2] * vectorAction[2]
+ vectorAction[3] * vectorAction[3]
));
}
/// <summary>

6
config/sac_transfer/PushBlock.yaml


learning_rate_schedule: linear
model_schedule: constant
batch_size: 128
buffer_size: 2000000
buffer_size: 6000000
buffer_init_steps: 0
tau: 0.005
steps_per_update: 10.0

forward_layers: 2
value_layers: 2
action_layers: 2
feature_size: 256
feature_size: 128
action_feature_size: 64
separate_policy_train: true
separate_policy_net: true

gamma: 0.99
strength: 1.0
keep_checkpoints: 5
max_steps: 2000000
max_steps: 6000000
time_horizon: 64
summary_freq: 100000
threaded: true

2
config/sac_transfer/PushBlockTransfer.yaml


train_model: false
load_action: true
train_action: false
transfer_path: "results/block-f256/PushBlock"
transfer_path: "results/block-long/PushBlock"
network_settings:
normalize: false
hidden_units: 256

正在加载...
取消
保存