Skip to content

Commit

Permalink
Upd config setting
Browse files Browse the repository at this point in the history
  • Loading branch information
emnigma committed Aug 4, 2023
1 parent 4096b9d commit afd90ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 6 additions & 5 deletions VSharp.ML.AIAgent/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@


class GeneralConfig:
SERVER_COUNT = 3
NUM_GENERATIONS = 2
NUM_PARENTS_MATING = 2
KEEP_ELITISM = None
NUM_SOLUTIONS = None
SERVER_COUNT = 16
NUM_GENERATIONS = 20
NUM_PARENTS_MATING = 22
KEEP_ELITISM = 18
NUM_RANDOM_SOLUTIONS = 60
NUM_RANDOM_LAST_LAYER = 18
MAX_STEPS = 3000
MUTATION_PERCENT_GENES = 4
LOGGER_LEVEL = logging.INFO
Expand Down
8 changes: 5 additions & 3 deletions VSharp.ML.AIAgent/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ def main():

model.forward(*ml.onnx.onnx_import.create_torch_dummy_input())

random_population = create_population(lo=-5, hi=5, model=model, population_size=60)
random_population = create_population(
lo=-5, hi=5, model=model, population_size=GeneralConfig.NUM_RANDOM_SOLUTIONS
)
with_random_last_layer = [
model_weights_with_random_last_layer(lo=-1, hi=1, model=model)
for _ in range(18)
for _ in range(GeneralConfig.NUM_RANDOM_LAST_LAYER)
]
with_last_layer1 = model_weights_with_last_layer(
[
Expand Down Expand Up @@ -65,7 +67,7 @@ def main():
server_count=GeneralConfig.SERVER_COUNT,
num_generations=GeneralConfig.NUM_GENERATIONS,
num_parents_mating=GeneralConfig.NUM_PARENTS_MATING,
keep_elitism=2,
keep_elitism=GeneralConfig.KEEP_ELITISM,
parent_selection_type=ParentSelectionType.STOCHASTIC_UNIVERSAL_SELECTION,
crossover_type=CrossoverType.SINGLE_POINT,
mutation_type=MutationType.RANDOM,
Expand Down

0 comments on commit afd90ec

Please sign in to comment.