浏览代码

update models

/ai-hw-2021
Ruo-Ping Dong 3 年前
当前提交
b6076cb9
共有 11 个文件被更改,包括 1724 次插入495 次删除
  1. 16
      Project/Assets/ML-Agents/Examples/3DBall/Prefabs/3DBall.prefab
  2. 73
      Project/Assets/ML-Agents/Examples/3DBall/Scenes/3DBall.unity
  3. 941
      Project/Assets/ML-Agents/Examples/3DBall/TFModels/MYMODEL_in8_out100_reshape.onnx
  4. 2
      Project/Assets/ML-Agents/Examples/3DBall/TFModels/MYMODEL_in8_out100_reshape.onnx.meta
  5. 168
      Project/Assets/ML-Agents/Examples/Basic/Scenes/Basic.unity
  6. 2
      com.unity.ml-agents/Runtime/Training/Trainer.cs
  7. 2
      com.unity.ml-agents/Runtime/Training/TrainingModelRunner.cs
  8. 1001
      Project/Assets/ML-Agents/Examples/Basic/TFModels/MYMODEL_in20_out3.onnx
  9. 14
      Project/Assets/ML-Agents/Examples/Basic/TFModels/MYMODEL_in20_out3.onnx.meta
  10. 0
      /Project/Assets/ML-Agents/Examples/3DBall/TFModels/MYMODEL_in8_out100_reshape.onnx
  11. 0
      /Project/Assets/ML-Agents/Examples/3DBall/TFModels/MYMODEL_in8_out100_reshape.onnx.meta

16
Project/Assets/ML-Agents/Examples/3DBall/Prefabs/3DBall.prefab


m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!54 &54597526346971362
Rigidbody:
m_ObjectHideFlags: 0

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &1321468028730240
GameObject:
m_ObjectHideFlags: 0

VectorActionDescriptions: []
VectorActionSpaceType: 0
hasUpgradedBrainParametersWithActionSpec: 1
m_Model: {fileID: 5022602860645237092, guid: 115ee9c4578384e26b8fd97aab2d76b2, type: 3}
m_InferenceDevice: 2
m_Model: {fileID: 5022602860645237092, guid: 30ee955a3764546ccbdc66072cf566c9, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 3
m_BehaviorName: 3DBall
TeamId: 0

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &1854695166504686
GameObject:
m_ObjectHideFlags: 0

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &1859240399150782
GameObject:
m_ObjectHideFlags: 0

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!1 &1999020414315134
GameObject:
m_ObjectHideFlags: 0

m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:

m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}

73
Project/Assets/ML-Agents/Examples/3DBall/Scenes/3DBall.unity


--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
serializedVersion: 12
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2

m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
m_LightingSettings: {fileID: 491384953}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2

manualTileSize: 0
tileSize: 256
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3}
--- !u!850595691 &491384953
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Settings.lighting
serializedVersion: 3
m_GIWorkflowMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 1
m_BakeBackend: 0
m_LightmapMaxSize: 1024
m_BakeResolution: 40
m_Padding: 2
m_TextureCompression: 1
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 2
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 2
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_FinalGather: 0
m_FinalGatherRayCount: 256
m_FinalGatherFiltering: 1
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVREnvironmentSampleCount: 500
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRMinBounces: 2
m_PVREnvironmentMIS: 0
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
--- !u!1001 &502565578
PrefabInstance:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: b1f466227168940b7ac84e337e9fcc8a, type: 3}
m_Name:
m_EditorClassIdentifier:
m_TrainingId: default
m_Greedy: 0
m_Greedy: 0.2
m_Train: 1
m_LoadTrainedModel: 1
m_Model: {fileID: 0}
--- !u!114 &1583402090
MonoBehaviour:
m_ObjectHideFlags: 0

941
Project/Assets/ML-Agents/Examples/3DBall/TFModels/MYMODEL_in8_out100_reshape.onnx
文件差异内容过多而无法显示
查看文件

2
Project/Assets/ML-Agents/Examples/3DBall/TFModels/MYMODEL_in8_out100_reshape.onnx.meta


fileFormatVersion: 2
guid: 0f7c224f06ff5488ca51f68add34b904
guid: 30ee955a3764546ccbdc66072cf566c9
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}

168
Project/Assets/ML-Agents/Examples/Basic/Scenes/Basic.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_IndirectSpecularColor: {r: 0.44971168, g: 0.4997775, b: 0.57563686, a: 1}
serializedVersion: 11
serializedVersion: 12
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2

m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
m_LightingSettings: {fileID: 334011281}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2

manualTileSize: 0
tileSize: 256
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}

m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalPosition.x
value: 106.38621
objectReference: {fileID: 0}

- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalPosition.z
value: 34.72934
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.w
value: 0.8681629
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.x

propertyPath: m_LocalRotation.z
value: 0.13088542
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_LocalRotation.w
value: 0.8681629
objectReference: {fileID: 0}
- target: {fileID: 4943719350691982, guid: 5889392e3f05b448a8a06c5def6c2dec, type: 3}
propertyPath: m_RootOrder
value: 1
objectReference: {fileID: 0}
--- !u!850595691 &334011281
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Settings.lighting
serializedVersion: 3
m_GIWorkflowMode: 1
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 1
m_BakeBackend: 0
m_LightmapMaxSize: 1024
m_BakeResolution: 40
m_Padding: 2
m_TextureCompression: 1
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 2
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 2
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_FinalGather: 0
m_FinalGatherRayCount: 256
m_FinalGatherFiltering: 1
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVREnvironmentSampleCount: 500
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRMinBounces: 2
m_PVREnvironmentMIS: 0
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
--- !u!1001 &1502457254
PrefabInstance:
m_ObjectHideFlags: 0

m_Modifications:
- target: {fileID: 224194346362733190, guid: 3ce107b4a79bc4eef83afde434932a68,
type: 3}
propertyPath: m_LocalPosition.x
propertyPath: m_Pivot.x
propertyPath: m_LocalPosition.y
propertyPath: m_Pivot.y
propertyPath: m_LocalPosition.z
value: 0
propertyPath: m_RootOrder
value: 3
propertyPath: m_LocalRotation.x
propertyPath: m_AnchorMax.x
propertyPath: m_LocalRotation.y
propertyPath: m_AnchorMax.y
propertyPath: m_LocalRotation.z
propertyPath: m_AnchorMin.x
propertyPath: m_LocalRotation.w
value: 1
propertyPath: m_AnchorMin.y
value: 0
propertyPath: m_RootOrder
value: 3
propertyPath: m_SizeDelta.x
value: 0
propertyPath: m_AnchoredPosition.x
propertyPath: m_SizeDelta.y
propertyPath: m_AnchoredPosition.y
propertyPath: m_LocalPosition.x
propertyPath: m_SizeDelta.x
propertyPath: m_LocalPosition.y
propertyPath: m_SizeDelta.y
propertyPath: m_LocalPosition.z
propertyPath: m_AnchorMin.x
value: 0
propertyPath: m_LocalRotation.w
value: 1
propertyPath: m_AnchorMin.y
propertyPath: m_LocalRotation.x
propertyPath: m_AnchorMax.x
propertyPath: m_LocalRotation.y
propertyPath: m_AnchorMax.y
propertyPath: m_LocalRotation.z
propertyPath: m_Pivot.x
propertyPath: m_AnchoredPosition.x
propertyPath: m_Pivot.y
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []

m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4748436652256066, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4748436652256066, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}

value: 0
objectReference: {fileID: 0}
- target: {fileID: 4748436652256066, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4748436652256066, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}

propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4748436652256066, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4748436652256066, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4939386490834352, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3}
propertyPath: m_LocalScale.z
value: 6.270299

propertyPath: m_BrainParameters.vectorObservationSize
value: 0
propertyPath: m_Model
value:
objectReference: {fileID: 5022602860645237092, guid: a0fb06c0cc6c445f3b2baafee04e8dd2,
type: 3}
- target: {fileID: 114502619508238574, guid: c5eb289873aca4f5a8cc59c7464ab7c1,
type: 3}
propertyPath: m_BehaviorType
value: 3
objectReference: {fileID: 0}
- target: {fileID: 114502619508238574, guid: c5eb289873aca4f5a8cc59c7464ab7c1,
type: 3}

- target: {fileID: 114502619508238574, guid: c5eb289873aca4f5a8cc59c7464ab7c1,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 5022602860645237092, guid: b6df909c6da0e49d39650555d30cae9d,
type: 3}
- target: {fileID: 114502619508238574, guid: c5eb289873aca4f5a8cc59c7464ab7c1,
type: 3}
propertyPath: m_BehaviorType
value: 3
propertyPath: m_BrainParameters.vectorObservationSize
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c5eb289873aca4f5a8cc59c7464ab7c1, type: 3}

m_Script: {fileID: 11500000, guid: b1f466227168940b7ac84e337e9fcc8a, type: 3}
m_Name:
m_EditorClassIdentifier:
m_TrainingId: default
m_LoadTrainedModel: 1
m_Model: {fileID: 0}

2
com.unity.ml-agents/Runtime/Training/Trainer.cs


var samples = m_Buffer.SampleBatch(m_Config.batchSize);
loss += m_ModelRunner.UpdateModel(samples);
}
Debug.Log($"Loss: {loss/m_Config.numSamplingAndUpdates}");
Debug.Log($"Step {m_TrainingStep} Loss: {loss/m_Config.numSamplingAndUpdates}");
m_ModelRunner.SaveModelToFile();
// Update target network

2
com.unity.ml-agents/Runtime/Training/TrainingModelRunner.cs


int[] stateShape = initState.shape.ToArray();
if (MyTimeScaleSetting.instance.LoadTrainedModel && MyTimeScaleSetting.instance.Model != null)
{
Debug.Log("load model");
Debug.Log($"load model: {modelPath}");
initState = LoadModelFromFile(modelPath, stateShape);
}

1001
Project/Assets/ML-Agents/Examples/Basic/TFModels/MYMODEL_in20_out3.onnx
文件差异内容过多而无法显示
查看文件

14
Project/Assets/ML-Agents/Examples/Basic/TFModels/MYMODEL_in20_out3.onnx.meta


fileFormatVersion: 2
guid: a0fb06c0cc6c445f3b2baafee04e8dd2
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 683b6cb6d0a474744822c888b46772c9, type: 3}
optimizeModel: 1
forceArbitraryBatchSize: 1
treatErrorsAsWarnings: 0
importMode: 1

/Project/Assets/ML-Agents/Examples/3DBall/TFModels/MYMODEL_in8_out100_2d.onnx → /Project/Assets/ML-Agents/Examples/3DBall/TFModels/MYMODEL_in8_out100_reshape.onnx

/Project/Assets/ML-Agents/Examples/3DBall/TFModels/MYMODEL_in8_out100_2d.onnx.meta → /Project/Assets/ML-Agents/Examples/3DBall/TFModels/MYMODEL_in8_out100_reshape.onnx.meta

正在加载...
取消
保存