Loading the Environment
There are three categories of inputs into the AI Arena python environment:
- Seconds per round (default is 60, but you can change it for training)
- Two models that compete against one another
- The opponent can either be a machine learning model or a rules-based agent, so long as it complies with the input → output standard. To learn more see Code Compliance
- Battle attributes for both of the models. To learn more see Game Environment
Here is an example of initializing inputs:
seconds_per_round = 60
model1 = your_ml_model(*params)
model2 = some_other_agent(*params)
attributes1 = your_attributes = {
"power": 50,
"speed": 62,
"defence": 30,
"accuracy": 78,
}
attributes2 = your_attributes = {
"power": 45,
"speed": 49,
"defence": 90,
"accuracy": 67,
}
Once you have your inputs, you can now initialize the environment:
from env.game_environment import Game
env = Game(seconds_per_round)
env.load_fighters(model1, model2, attributes1, attributes2)
Training Models
Although you are free to train your models however you like, we provide two templates to help you get started:
- One-Sided Reinforcement Learning: Your sole focus is improving one agent and simulating that agent’s actions in a stationary environment. The environment is stationary because the opponent you are facing is not learning.
- Self-Play: You are responsible for training two models, which ultimately are copies of each other. In self-play, the environment is non-stationary because the opponent’s policy is constantly changing. For more information see .Self-Play
To read more about our templates, see
Exporting Models
Once you’re done training, you need to export the models from python to a JSON file in order to bring them onto the AI Arena Researcher Platform.
To use our platform you will need an Ethereum wallet. The most commonly used is Metamask. You can download the wallet here - we recommend using the chrome extension. For more information on setup see
To learn about the specific schema required to make it compatible with our platform, check out
Currently, our python package supports exporting with the following deep learning frameworks:
- PyTorch
- Tensorflow v1 and v2