Skip to main content

Host Your Training

Once you've created your training you are ready to actually use the EzSpark ecosystem to generate models able to interact with your gym environment

What you'll need

  • Python version 3.7 to 3.10
  • Pyezspark
  • a Gym Environment installed locally on your machine

To check your version

python --version

To Install Pyezspark

pip install Pyezspark

Public & Private keys

To be able to Host your training and connect to the EzSpark ecosystem you will need to import your training_public_key and training_private_key in your python code

  • Go to https://app.ezspark.ai

  • Click on My Account on the top-right corner

  • Click on My Training

  • Click on the Info button of the training you are interested in and a sequence of parameters will show up

  • Then you can copy-paste the training_public_key and training_private_key in your python code

import pyezspark
training_public_key = ''
training_private_key = ''
ez = pyezspark.EzSpark(training_public_key, training_private_key = training_private_key)
ez.execute()

Further parameters

In the python code you can also set up other parameters

import pyezspark
training_public_key = ''
training_private_key = ''
max_number_of_genomes_per_client = 400
t_val = 5
max_number_of_trainers = 30
threads = 4
ez = pyezspark.EzSpark(training_public_key, training_private_key = training_private_key,
max_number_of_genomes_per_client=max_number_of_genomes_per_client,
t_val=t_val, max_number_of_trainers=max_number_of_trainers)
ez.execute(threads=threads)
  • max_number_of_genomes_per_client indicates how many genomes will be assigned at most to each connected user for each interaction

  • t_val is a value that will be added to the timeout that is set for the last interaction of a user. When the timeout expires that user is considered disconnected

  • max_number_of_trainers is the maximum number of trainers that your local machine will handle

  • threads is the number of threads used when running the training on your local machine

Look what's happening

After your training is online and visible by other users you can actually monitor what happens on http://0.0.0.0:5000