Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ktimam/SoccerTrainer
https://github.com/ktimam/SoccerTrainer
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ktimam/SoccerTrainer
- Owner: ktimam
- Created: 2024-05-06T22:02:30.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-10-22T17:51:50.000Z (16 days ago)
- Last Synced: 2024-10-23T20:37:37.026Z (15 days ago)
- Language: Assembly
- Size: 49.3 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-internet-computer - ICSoccerWorld Trainer - Flashlight multilayer perceptron deep learning used for training soccer agents on ICP. (Decentralized AI / Solana)
README
# ICSoccerWorld Server
Backend for a soccer simulation built for ICP using ICPP. Based on code sample from book "AI Game Programming by Example".
Demo is built in C++ and uses Jolt physics Engine. Flashlight Multilayer Perceptron Deep Learning used for training Soccer Agents on ICP blockchain.### Prerequisites
dfx
icpp## Installation
ICP Build Steps (Workaround to ICP exports Limit):```bash
1. clear && icpp build-wasm --config=icpp_libraries.toml && wasm2wat build/SimSoccerServer.wasm --output=build/SimSoccerServer.wasm.wat2. edit .wat file with editor to remove all lines having export except:
(export "canister_update start_match" (func 2489))
(export "canister_update play_match" (func 352))
(export "canister_update delete_file" (func 1370))
(export "canister_update train" (func 117))
(export "canister_query file_download_chunk" (func 148))
(export "canister_query health" (func 1753))
(export "canister_update file_upload_chunk" (func 194))3. wat2wasm build/SimSoccerServer.wasm.wat --output=build/SimSoccerServer_noexports.wasm && ../binaryen/bin/wasm-opt build/SimSoccerServer_noexports.wasm -o build/SimSoccerServer.wasm -Oz --enable-bulk-memory && dfx deploy
```
## Usage
### Local
Usage examples for local query:Frontend:
https://gb4ri-5yaaa-aaaal-ac3hq-cai.raw.icp0.io/```bash
$ dfx canister --network local call SimSoccerServer start
$ dfx canister --network local call SimSoccerServer play_match '(1674211940: nat64, 60: nat64)'
```Usage examples for uploading training data and training:
```bash
$ dfx canister --network local call SimSoccerServer delete_file '("Models/latest_model": text)'
$ python -m scripts.upload Models/observations.txt --network local --canister SimSoccerServer
$ python -m scripts.upload Models/actions.txt --network local --canister SimSoccerServer
$ dfx canister --network local call SimSoccerServer train '("Models/latest_model": text, "Models/observations.txt": text, "Models/actions.txt": text, 20: nat64, 0.009: float32)'
```## License
This project is licensed under the MIT license.