-
Notifications
You must be signed in to change notification settings - Fork 7
/
config.ini
112 lines (101 loc) · 2.59 KB
/
config.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
[Game]
; Size of the game, in number of cells.
; @type: tuple(int, int)
board_size = (15, 15)
; Fix random numbers.
; @type: int
seed = None
[WindowGame]
; Display a window for the game in pygame.
; It can be better to set False when training.
; @type: bool
render = True
; Show a grid on the game.
; You can activate it by pressing the key 'g'.
; @type: bool
show_grid = True
; Show the snakes' vision.
; You can activate it by pressing the key 'v'.
; @type: bool
show_vision = False
; Width & height of a cell, in pixel.
; @type: int
cell_size = 50
; FPS of the playble game.
; @type: int
fps_play = 10
; FPS when training snakes.
; @type: int
fps_train = 1000
[Snake]
; The initial length of a snake.
; @type: int
length = 3
; The vision mode used as input in the neural network.
; Either 'distance' or 'binary'
; @type: str
vision_type = "binary"
; The mode used to detect the objects.
; @type: int
vision_mode = 8
; Maximal lifespan of a snake.
; @type: int
lifespan_max = None
; Steps without scoring
; @type: int
hunger_max = 500
[NeuralNetwork]
; Hidden layers dimensions.
; @type: list(int)
hidden_layers = [20, 12]
; Activation function used in the hidden layers.
; Options are sigmoid, tanh, relu, leaky_relu, linear, softmax
; @type: function
activation_hidden = relu
; Activation function used in the last layer.
; Options are sigmoid, tanh, relu, leaky_relu, linear, softmax
; @type: function
activation_output = softmax
[GeneticAlgorithm]
; Save the best individuals for each generation.
; @type: bool
save_best_individuals = True
; Save all individuals from a generation.
; @type: bool
save_generations = False
; Save an individual or a population each x steps.
; @type: int
save_steps = 10
; Directory where individuals are saved.
; @type: str
save_dir = "saves"
; Number of generations.
; @type: int
num_generations = 3000
; Number of parents. Parents won't have mutated genes and crossover.
; @type: int
num_parents = 500
; Number of offspring. Offspring may have mutated genes and crossover.
; @type: int
num_offspring = 1000
; Probability that Simulated Binary Crossover occurs.
; @type: float [0, 1]
probability_SBX = 0.5
; Probability that Single Point Binary Crossover occurs.
; @type: float [0, 1]
probability_SPBX = 0.5
; eta parameter for Simulated Binary Crossover.
; @type: int
eta_SBX = 100
; Gaussian mean.
; @type: float
gaussian_mu = 0
; Gaussian standard deviation.
; @type: float
gaussian_std = 1
; Mutation rate. Probability that a chromosome mutate.
; @type: float
mutation_rate = 0.005
; Type of crossover. Options are 'roulette_wheel', 'elitism'
; @type: str
crossover_selection_type = "roulette_wheel"