浏览代码

PushJump modifications

/goal-conditioning/new
Arthur Juliani 4 年前
当前提交
759fd2b5
共有 32 个文件被更改,包括 2086 次插入5 次删除
  1. 2
      ml-agents/mlagents/trainers/torch/layers.py
  2. 19
      Project/Assets/ML-Agents/Examples/PushJump/Scripts/WJPBAgent.cs
  3. 26
      config/ppo/PushJump.yaml
  4. 1001
      Project/Assets/ML-Agents/Examples/PushJump/Prefabs/PushJumpArea.prefab
  5. 1001
      Project/Assets/ML-Agents/Examples/PushJump/Scenes/PushJump.unity
  6. 14
      Project/Assets/ML-Agents/Examples/PushJump/TFModels/WJPB-32499994.onnx.meta
  7. 14
      Project/Assets/ML-Agents/Examples/PushJump/TFModels/WJPB-4999918.onnx.meta
  8. 14
      Project/Assets/ML-Agents/Examples/PushJump/TFModels/cloud.onnx.meta
  9. 0
      /Project/Assets/ML-Agents/Examples/PushJump.meta
  10. 0
      /Project/Assets/ML-Agents/Examples/PushJump/Materials.meta
  11. 0
      /Project/Assets/ML-Agents/Examples/PushJump/Materials
  12. 0
      /Project/Assets/ML-Agents/Examples/PushJump/Meshes.meta
  13. 0
      /Project/Assets/ML-Agents/Examples/PushJump/Meshes
  14. 0
      /Project/Assets/ML-Agents/Examples/PushJump/Prefabs.meta
  15. 0
      /Project/Assets/ML-Agents/Examples/PushJump/Prefabs/PushJumpArea.prefab.meta
  16. 0
      /Project/Assets/ML-Agents/Examples/PushJump/Scenes.meta
  17. 0
      /Project/Assets/ML-Agents/Examples/PushJump/Scenes/PushJump.unity.meta
  18. 0
      /Project/Assets/ML-Agents/Examples/PushJump/Scripts.meta
  19. 0
      /Project/Assets/ML-Agents/Examples/PushJump/Scripts
  20. 0
      /Project/Assets/ML-Agents/Examples/PushJump/TFModels.meta
  21. 0
      /Project/Assets/ML-Agents/Examples/PushJump/TFModels/BigWallJump.nn
  22. 0
      /Project/Assets/ML-Agents/Examples/PushJump/TFModels/BigWallJump.nn.meta
  23. 0
      /Project/Assets/ML-Agents/Examples/PushJump/TFModels/SmallWallJump.nn
  24. 0
      /Project/Assets/ML-Agents/Examples/PushJump/TFModels/SmallWallJump.nn.meta
  25. 0
      /Project/Assets/ML-Agents/Examples/PushJump/TFModels/WJPB-32499994.onnx
  26. 0
      /Project/Assets/ML-Agents/Examples/PushJump/TFModels/WJPB-4999918.onnx
  27. 0
      /Project/Assets/ML-Agents/Examples/PushJump/TFModels/cloud.onnx

2
ml-agents/mlagents/trainers/torch/layers.py


if isinstance(layer, Swish):
activation = layer(activation)
else:
activation = layer(activation) + self.goal_encoders[idx // 2](
activation = layer(activation) * self.goal_encoders[idx // 2](
goal_tensor
)
return activation

19
Project/Assets/ML-Agents/Examples/PushJump/Scripts/WJPBAgent.cs


public GameObject ground;
public GameObject spawnArea;
Bounds m_SpawnAreaBounds;
GoalSensorComponent goalSensor;
public GameObject wallJumpGoal;
public GameObject pushBlockGoal;

sensor.AddObservation(agentPos / 20f);
sensor.AddObservation(DoGroundCheck(true) ? 1 : 0);
sensor.AddObservation(m_GoalOneHot);
goalSensor = this.GetComponent<GoalSensorComponent>();
goalSensor.AddGoal(m_GoalOneHot);
}
/// <summary>

public void MoveAgent(ActionSegment<int> act)
{
AddReward(-0.0005f);
AddReward(-0.0002f);
var smallGrounded = DoGroundCheck(true);
var largeGrounded = DoGroundCheck(false);

SetReward(1f);
EndEpisode();
}
else
{
SetReward(-1f);
EndEpisode();
}
}
}

{
SetReward(1f);
EndEpisode();
}
else
{
SetReward(-1f);
EndEpisode();
}
}

m_PushRenderer.material = goalMaterial;
}
var height = m_ResetParams.GetWithDefault("big_wall_height", 8);
var height = m_ResetParams.GetWithDefault("big_wall_height", 4);
var localScale = wall.transform.localScale;
localScale = new Vector3(
localScale.x,

26
config/ppo/PushJump.yaml


behaviors:
WJPB:
trainer_type: ppo
hyperparameters:
batch_size: 128
buffer_size: 5000
learning_rate: 0.0003
beta: 0.01
epsilon: 0.2
lambd: 0.95
num_epoch: 3
learning_rate_schedule: linear
network_settings:
normalize: false
hidden_units: 64
num_layers: 2
vis_encode_type: simple
reward_signals:
extrinsic:
gamma: 0.99
strength: 1.0
keep_checkpoints: 5
max_steps: 2000000
time_horizon: 64
summary_freq: 30000
threaded: true

1001
Project/Assets/ML-Agents/Examples/PushJump/Prefabs/PushJumpArea.prefab
文件差异内容过多而无法显示
查看文件

1001
Project/Assets/ML-Agents/Examples/PushJump/Scenes/PushJump.unity
文件差异内容过多而无法显示
查看文件

14
Project/Assets/ML-Agents/Examples/PushJump/TFModels/WJPB-32499994.onnx.meta


fileFormatVersion: 2
guid: 960b1933b6ec84fcb83c0c79668a4ee8
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 683b6cb6d0a474744822c888b46772c9, type: 3}
optimizeModel: 1
forceArbitraryBatchSize: 1
treatErrorsAsWarnings: 0

14
Project/Assets/ML-Agents/Examples/PushJump/TFModels/WJPB-4999918.onnx.meta


fileFormatVersion: 2
guid: 84bee0873d0be4a56b46a9884553728d
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 683b6cb6d0a474744822c888b46772c9, type: 3}
optimizeModel: 1
forceArbitraryBatchSize: 1
treatErrorsAsWarnings: 0

14
Project/Assets/ML-Agents/Examples/PushJump/TFModels/cloud.onnx.meta


fileFormatVersion: 2
guid: 15e1a204928a14cfa910f8c51edaf85f
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 683b6cb6d0a474744822c888b46772c9, type: 3}
optimizeModel: 1
forceArbitraryBatchSize: 1
treatErrorsAsWarnings: 0

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock.meta → /Project/Assets/ML-Agents/Examples/PushJump.meta

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials.meta → /Project/Assets/ML-Agents/Examples/PushJump/Materials.meta

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Materials → /Project/Assets/ML-Agents/Examples/PushJump/Materials

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Meshes.meta → /Project/Assets/ML-Agents/Examples/PushJump/Meshes.meta

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Meshes → /Project/Assets/ML-Agents/Examples/PushJump/Meshes

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Prefabs.meta → /Project/Assets/ML-Agents/Examples/PushJump/Prefabs.meta

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Prefabs/WallJumpandPushblockArea.prefab.meta → /Project/Assets/ML-Agents/Examples/PushJump/Prefabs/PushJumpArea.prefab.meta

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scenes.meta → /Project/Assets/ML-Agents/Examples/PushJump/Scenes.meta

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scenes/WallJumpAndPushblock.unity.meta → /Project/Assets/ML-Agents/Examples/PushJump/Scenes/PushJump.unity.meta

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scripts.meta → /Project/Assets/ML-Agents/Examples/PushJump/Scripts.meta

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/Scripts → /Project/Assets/ML-Agents/Examples/PushJump/Scripts

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels.meta → /Project/Assets/ML-Agents/Examples/PushJump/TFModels.meta

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/BigWallJump.nn → /Project/Assets/ML-Agents/Examples/PushJump/TFModels/BigWallJump.nn

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/BigWallJump.nn.meta → /Project/Assets/ML-Agents/Examples/PushJump/TFModels/BigWallJump.nn.meta

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/SmallWallJump.nn → /Project/Assets/ML-Agents/Examples/PushJump/TFModels/SmallWallJump.nn

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/SmallWallJump.nn.meta → /Project/Assets/ML-Agents/Examples/PushJump/TFModels/SmallWallJump.nn.meta

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/WJPB-32499994.onnx → /Project/Assets/ML-Agents/Examples/PushJump/TFModels/WJPB-32499994.onnx

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/WJPB-4999918.onnx → /Project/Assets/ML-Agents/Examples/PushJump/TFModels/WJPB-4999918.onnx

/Project/Assets/ML-Agents/Examples/WallJumpAndPushblock/TFModels/cloud.onnx → /Project/Assets/ML-Agents/Examples/PushJump/TFModels/cloud.onnx

正在加载...
取消
保存