Skip to content

Commit

Permalink
Merge pull request #5 from Pristar4/develop
Browse files Browse the repository at this point in the history
Updated ml-agents
  • Loading branch information
Pristar4 authored Jul 13, 2023
2 parents db7185f + c18b3ff commit c260328
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 88 deletions.
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
path = doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
[submodule "ml-agents"]
url = https://github.com/Unity-Technologies/ml-agents
path = ml-agents
url = https://github.com/Pristar4/ml-agents
77 changes: 1 addition & 76 deletions Assets/ML-Agents/Timers/AI_timers.json
Original file line number Diff line number Diff line change
@@ -1,76 +1 @@
{
"count": 1,
"self": 10.819744799999999,
"total": 11.2268753,
"children": {
"InitializeActuators": {
"count": 8,
"self": 0.0015133,
"total": 0.0015133,
"children": null
},
"InitializeSensors": {
"count": 8,
"self": 0.0015168,
"total": 0.0015168,
"children": null
},
"AgentSendState": {
"count": 60,
"self": 0.0010157,
"total": 0.2497354,
"children": {
"CollectObservations": {
"count": 480,
"self": 0.2456526,
"total": 0.2456526,
"children": null
},
"WriteActionMask": {
"count": 480,
"self": 0.0010668,
"total": 0.0010668,
"children": null
},
"RequestDecision": {
"count": 480,
"self": 0.0020003,
"total": 0.0020003,
"children": null
}
}
},
"DecideAction": {
"count": 60,
"self": 0.0015038,
"total": 0.0015038,
"children": null
},
"AgentAct": {
"count": 60,
"self": 0.1528612,
"total": 0.1528612,
"children": null
}
},
"gauges": {
"SnakeAi.CumulativeReward": {
"count": 71,
"max": 19.3010044,
"min": -11.4027328,
"runningAverage": -9.782438,
"value": -11.1,
"weightedAverage": -11.1100969
}
},
"metadata": {
"timer_format_version": "0.1.0",
"start_time_seconds": "1689188193",
"unity_version": "2023.1.3f1",
"command_line_arguments": "C:\\Program Files\\Unity\\Hub\\Editor\\2023.1.3f1\\Editor\\Unity.exe -projectpath C:\\Users\\felix\\SnakeGame -useHub -hubIPC -cloudEnvironment production",
"communication_protocol_version": "1.5.0",
"com.unity.ml-agents_version": "2.3.0-exp.3",
"scene_name": "AI",
"end_time_seconds": "1689188204"
}
}
{"count":1,"self":52.1213024,"total":203.22109279999998,"children":{"InitializeActuators":{"count":8,"self":0.0015027999999999999,"total":0.0015027999999999999,"children":null},"InitializeSensors":{"count":8,"self":0.0009995,"total":0.0009995,"children":null},"AgentSendState":{"count":11931,"self":0.3958809,"total":46.6378529,"children":{"CollectObservations":{"count":95448,"self":45.2260704,"total":45.2260693,"children":null},"WriteActionMask":{"count":95448,"self":0.069559,"total":0.069559,"children":null},"RequestDecision":{"count":95448,"self":0.24414899999999998,"total":0.9463437,"children":{"AgentInfo.ToProto":{"count":95448,"self":0.2084828,"total":0.7021947,"children":{"GenerateSensorData":{"count":95448,"self":0.4937119,"total":0.4937119,"children":null}}}}}}},"DecideAction":{"count":11931,"self":86.9446208,"total":86.9446225,"children":null},"AgentAct":{"count":11931,"self":17.4810832,"total":17.5128017,"children":{"AgentInfo.ToProto":{"count":3755,"self":0.0141082,"total":0.0317178,"children":{"GenerateSensorData":{"count":3755,"self":0.0176096,"total":0.0176096,"children":null}}}}}},"gauges":{"SnakeAi.CumulativeReward":{"count":3755,"max":30.8355713,"min":-11.4027338,"runningAverage":-8.165549,"value":21.9621029,"weightedAverage":7.757939}},"metadata":{"timer_format_version":"0.1.0","start_time_seconds":"1689234894","unity_version":"2023.1.3f1","command_line_arguments":"C:\\Program Files\\Unity\\Hub\\Editor\\2023.1.3f1\\Editor\\Unity.exe -projectpath C:\\Users\\felix\\SnakeGame -useHub -hubIPC -cloudEnvironment production","communication_protocol_version":"1.5.0","com.unity.ml-agents_version":"2.3.0-exp.4","scene_name":"AI","end_time_seconds":"1689235097"}}
35 changes: 25 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,19 +130,34 @@ Perform the following steps to set up and run the project:
```
4. Install ML-agents within the virtual environment by following the Getting Started in the
ml-agents rep
```
pip install mlagents
```
5. Start the training by running:
```
mlagents-learn config/ppo/Snake.yaml --run-id=trainingRun01
5. ```
python.exe -m pip install --upgrade pip
```
6. ```
pip install torch -f https://download.pytorch.org/whl/torch_stable.html
```
7. ```
pip install tensorboard
```
6. Open a second terminal and start TensorBoard to monitor training.
7. ```
pip install -e ./ml-agents-envs
```
tensorboard --logdir results
8. ```
pip install -e ./ml-agents
```
7. Enter the Play mode in the Unity editor in the AI scene
under ``SnakeGame\Assets\SnakeGame\_Levels\AI``.
9. ```
pip install tensorboard
```
9. Start the training by running:
```
mlagents-learn config/ppo/Snake.yaml --run-id=trainingRun01
```
10. Open a second terminal and start TensorBoard to monitor training.
```
tensorboard --logdir results
```
11. Enter the Play mode in the Unity editor in the AI scene
under ``SnakeGame\Assets\SnakeGame\_Levels\AI``.
<p align="right">(<a href="#readme-top">back to top</a>)</p>
Expand Down
2 changes: 1 addition & 1 deletion ml-agents
Submodule ml-agents updated 109 files

0 comments on commit c260328

Please sign in to comment.