forked from karinemiras/evoman_framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eedea71
commit 4029b88
Showing
6 changed files
with
70 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from base_evolutionary_algorithm import EvolutionaryAlgorithm | ||
|
||
from fitness import Fitness | ||
from crossover import Crossover | ||
from selection import Selection | ||
from insertion import Insertion | ||
from mutation import Mutation | ||
from mutation_selection import MutationSelection | ||
|
||
|
||
# Before you run evolutionary algorithm you can adjust following variables: | ||
|
||
# Crossover.offspring_ratio - says what's the offspring/parents ratio, default 1.5 | ||
# Selection.selection_ratio - says how many % of population should be selected, default 0.3 | ||
# Mutation.mutation_ratio - says how many % of genes will be mutated, default 0.1 | ||
# MutationSelection.selection_ratio - says how many % of given group should be selected, default 0.3 | ||
|
||
|
||
Mutation.mutation_ratio = 0.05 | ||
Selection.selection_ratio = 0.4 | ||
MutationSelection.selection_ratio = 0.4 | ||
|
||
# HYPERPARAMS | ||
population_size = 100 | ||
generations_number = 10 | ||
|
||
evolutionary_algorithm = EvolutionaryAlgorithm(_experiment_name='solution_2', | ||
_population_size=population_size, | ||
_generations_number=generations_number, | ||
_hidden_layer_size=10, | ||
_fitness=Fitness.basic, | ||
_selection=Selection.tournament_selection, | ||
_crossover=Crossover.basic, | ||
_mutation=Mutation.uniform_mutation, | ||
_mutation_selection=MutationSelection.only_parents, | ||
_insertion=Insertion.basic) | ||
|
||
evolutionary_algorithm.run() |