HH
4 年前
当前提交
6c67bf4e
共有 31 个文件被更改,包括 465 次插入 和 2947 次删除
-
46Project/Assets/ML-Agents/Examples/Walker/Prefabs/Ragdoll/WalkerRagdollBase.prefab
-
161Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgent.cs
-
1001Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerDynamicVariableSpeed.nn
-
2Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerDynamicVariableSpeed.nn.meta
-
1001Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerStatic.nn
-
2Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerStatic.nn.meta
-
2Project/ProjectSettings/ProjectVersion.txt
-
11Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/RewardManager.cs.meta
-
110Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/RewardManager.cs
-
1001Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerStaticApprovedWalkInWorldDir.nn
-
11Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerStaticApprovedWalkInWorldDir.nn.meta
-
8Project/Assets/ML-Agents/Examples/Walker/TFModels/New Folder.meta
-
8Project/Assets/ML-Agents/Examples/Walker/TFModels/with hh.meta
-
8Project/Assets/ML-Agents/Examples/Walker/TFModels/10k no hh.meta
-
8Project/Assets/ML-Agents/Examples/Walker/TFModels/15kstrength with hh.meta
-
8Project/Assets/ML-Agents/Examples/Walker/TFModels/20k no hh no rolling targ.meta
-
8Project/Assets/ML-Agents/Examples/Walker/TFModels/20kDistToTargCloud.meta
-
8Project/Assets/ML-Agents/Examples/Walker/TFModels/20kAvgVelAllBPMaxDist50.meta
-
8Project/Assets/ML-Agents/Examples/Walker/TFModels/20kAllBPVelRelPosClampedTo100.meta
-
0/Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerDynamic.nn
-
0/Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerDynamic.nn.meta
-
0/Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerStaticVariableSpeed.nn
-
0/Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerStaticVariableSpeed.nn.meta
1001
Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerDynamicVariableSpeed.nn
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
1001
Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerStatic.nn
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
m_EditorVersion: 2018.4.17f1 |
|||
m_EditorVersion: 2018.4.18f1 |
|
|||
fileFormatVersion: 2 |
|||
guid: 2d2b3caecf069467ebf3a650d8ee401e |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using Unity.MLAgents; |
|||
using UnityEngine; |
|||
|
|||
public class RewardManager : MonoBehaviour |
|||
{ |
|||
[Serializable] |
|||
public class Reward |
|||
{ |
|||
public string rewardKey; |
|||
// [Range(.01f, .05f)]
|
|||
public float rawVal; |
|||
public float rewardScalar = .01f; |
|||
// public float rewardScalar;
|
|||
public float rewardThisStep; |
|||
public float cumulativeThisEpisode; |
|||
public float cumulativeThisSession; |
|||
|
|||
// public float maxRewardThisSession;
|
|||
|
|||
public int lastNaNStep; |
|||
// public Reward(string k)
|
|||
// public Reward()
|
|||
// {
|
|||
//// rewardKey = k;
|
|||
// rewardScalar = .01f;
|
|||
// }
|
|||
} |
|||
|
|||
private Agent m_thisAgent; |
|||
public List<Reward> rewardsList = new List<Reward>(); |
|||
public Dictionary<string, Reward> rewardsDict = new Dictionary<string, Reward>(); |
|||
public float maxSteps; |
|||
private void OnEnable() |
|||
// private void Awake()
|
|||
{ |
|||
m_thisAgent = GetComponent<Agent>(); |
|||
maxSteps = m_thisAgent.MaxStep; |
|||
foreach (var item in rewardsList) |
|||
{ |
|||
if (rewardsDict.ContainsKey(item.rewardKey)) return; //don't need to add
|
|||
rewardsDict.Add(item.rewardKey, item); |
|||
} |
|||
} |
|||
|
|||
// public void AddReward(Reward r)
|
|||
// {
|
|||
// if (rewardsDict.ContainsKey(r.rewardKey)) return; //don't need to add
|
|||
// rewardsDict.Add(r.rewardKey, r);
|
|||
// }
|
|||
|
|||
// public void AddReward(string rewardKey)
|
|||
// {
|
|||
// if (rewardsDict.ContainsKey(rewardKey)) return; //don't need to add
|
|||
// Reward newReward = new Reward(rewardKey);
|
|||
// rewardsDict.Add(rewardKey, newReward);
|
|||
// rewardsList.Add(newReward);
|
|||
// }
|
|||
|
|||
//Add new rewards
|
|||
public void UpdateReward(string key, float rawVal) |
|||
{ |
|||
rewardsDict[key].rawVal = rawVal; |
|||
float scaledVal = rawVal * rewardsDict[key].rewardScalar; |
|||
|
|||
//if we get a NaN, set the step
|
|||
if (float.IsNaN(scaledVal)) |
|||
rewardsDict[key].lastNaNStep = m_thisAgent.StepCount; |
|||
|
|||
// rewardsDict[key].maxRewardThisSession = scaledVal * maxSteps;
|
|||
rewardsDict[key].rewardThisStep = scaledVal; |
|||
rewardsDict[key].cumulativeThisEpisode += scaledVal; |
|||
rewardsDict[key].cumulativeThisSession += scaledVal; |
|||
|
|||
m_thisAgent.AddReward(scaledVal); |
|||
} |
|||
|
|||
// //Add new rewards
|
|||
// public void UpdateReward(string key, float val)
|
|||
// {
|
|||
// rewardsDict[key].rewardThisStep = val;
|
|||
// rewardsDict[key].cumulativeThisEpisode += val;
|
|||
// rewardsDict[key].cumulativeThisSession += val;
|
|||
// m_thisAgent.AddReward(val);
|
|||
// }
|
|||
|
|||
//Resets cumulative episode reward
|
|||
public void ResetEpisodeRewards() |
|||
{ |
|||
foreach (var item in rewardsDict) |
|||
{ |
|||
item.Value.rewardThisStep = 0; |
|||
item.Value.cumulativeThisEpisode = 0; |
|||
} |
|||
} |
|||
|
|||
// Start is called before the first frame update
|
|||
void Start() |
|||
{ |
|||
|
|||
} |
|||
|
|||
// Update is called once per frame
|
|||
void Update() |
|||
{ |
|||
|
|||
} |
|||
} |
1001
Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerStaticApprovedWalkInWorldDir.nn
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: b857c29923dc040d5bc2194435a73ebd |
|||
ScriptedImporter: |
|||
fileIDToRecycleName: |
|||
11400000: main obj |
|||
11400002: model data |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3} |
|
|||
fileFormatVersion: 2 |
|||
guid: 4536394c7630c45d29363e1475a9e5cf |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: ee9fbb0156ff64d169b17780a398702a |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 6ecd0cba4f4484921949a0db709fef3d |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 9bf8e7dfffdb34e61a70f66fc9a337a5 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: b3414503c573d4815b63252e966c2673 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 8d773733493b846e9ac5f499b49ee72c |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: edfd5cf7fe9674978b62b3df669c4e0e |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 2d241685fc042499b9de5f4cc6f7deb0 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue