Skip to main content

Create a Training

Once you have created and installed your gym environment you are ready to setup a training on EzSpark

Registration

You must sign up on EzSpark to be able to create a training

Create a New Training

Fill The configuration form

At the moment EzSpark supports only genetic algorithm for training. In the next updates will be implemented a new distributed deep learning algorithm.

For the setup of the genetic training you can either fill the form or upload a json file like this:

{
"gym_game_name": "CartPole-v0",
"alone_training_iterations": 60,
"input_size": 4,
"output_size": 2,
"initial_population": 100,
"species_threshold": 3,
"generations": 600000,
"percentage_survivors_per_specie": 0.3,
"connection_mutation_rate": 0.8,
"new_connection_assignment_rate": 0.1,
"add_connection_big_specie_rate": 0.3,
"add_connection_small_specie_rate": 0.03,
"add_node_specie_rate": 0.05,
"activate_connection_rate": 0.25,
"remove_connection_rate": 0.01,
"children": 1,
"crossover_rate": 0.1,
"saving": 1,
"keep_parents": 1,
"limiting_species": 15,
"limiting_threshold": 5,
"max_population": 20000,
"same_fitness_limit": 10,
"age_significance": 0.3,
"max_number_of_games": 5,
"max_number_of_steps": 200,
"safeness": 0.5,
"sub_games": 1,
"minimum_reward": 0
}

Parameters

  • gym_game_name is the actual name of your environment (the environment name you have registred on your local machine)

  • alone_training_iteration is the number of generations that you run by yourself on your local machine before connecting with other users

  • input_size is the number of values of your obs (the number of values of the list numpy array you return from step and reset functions defined in your gym environment)

  • output_size is the the number of all the possible discrete actions you can take

  • initial_population is the initial number of genomes generated at the first generation

  • species_threshold higher is the threshold less species will be created during the genetic algorithm

  • generations is the number of generations you decided to run

  • percentage_survivors_per_specie 0<p<=1 is the top % of genomes from which new genomes will be generated for each specie

  • connection_mutation_rate 0<=p<=1 is the probability to change the weight of a connection between 2 nodes in a genome

  • new_connection_assignement_rate 0<= p <=1 is the probability, given the fact that a connection weight must change, to assign a completely new weight instead of shift by a small value the existing one

  • add_node_big_specie_rate 0<= p <=1 is the probability to add a new connection between 2 nodes in a genome given the fact that that genome is located in a specie with a lot of other genomes

  • add_node_small_specie_rate 0<= p <=1 is the probability to add a new connection between 2 nodes in a genome given the fact that that genome is located in a specie with few of other genomes

  • add_node_specie_rate 0<= p <=1 is the probability to split a connection and add a new node

  • activate_connection_rate 0<= p <=1 is the probability to activate a deactivated connection

  • remove_connection_rate 0<= p <=1 is the probability to deactivate an activated connection

  • children number of new genomes generated from each specie (it is multiplied by another factor)

  • crossover_rate 0<= p <=1 is the probability to do the interspecie crossover among best genomes

  • saving >= 1, each saving times the best genome of the generation is saved on your local machine

  • keep_parents, either 0 or 1, for the next generation you will make survive the best genomes of each specie

  • limiting_specie when a specie did not improve its best fitness for limiting_specie times it will be killed

  • limiting_threshold < limiting_specie when a specie did not improve its best fitness for limiting_threshold times the add_connection rate and remove_connection_rate will be switched

  • max_population is the maximum number of genomes you can have for each generation

  • same_fitness_limit if the training did not improve the best fitness for samefitness_limit times the add_connection... params will be increased

  • age_significance 0<= p <=1, when computing the fitness for a specie the age of the specie will be taken into consideration. Younger is the specie higher is the fitness. Higher is the age_significance, younger species will be taken immediatly into consideration

  • max_number_of_games is the maximum number of games that each genome for each generation will play

  • max_number_of_steps is the max number of steps that a genome will make for each game before considering it as done

  • safeness 0<= p <=1 to make your training safer. higher is the safeness, safer is your training, but also slower and will take more resources

  • sub_games 1<s<=max_number_of_games, is the number of games each client will play in parallel for each assigned genome. Higher = faster = more resources needed

  • minimum_reward is the minimum reward that can be given by the step(self,action) function of your gym environment

After uploading the file or filling the form click on Create