Skip to content

Commit

Permalink
fix: made changes to config
Browse files Browse the repository at this point in the history
  • Loading branch information
Vetlets05 committed Nov 5, 2024
1 parent 1ece820 commit 5103964
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def main(args):
if neat is not None: # TODO: Add option to insert new config into NEAT object.
generation_nums, best_fitnesses, avg_fitnesses, min_fitnesses = read_fitness_file(neat_name)
from_generation = generation_nums[-1] + 1
#config_instance = neat.config
config_instance = neat.config
else:
neat = NEAT(Config())
neat.initiate_genomes()
Expand Down
2 changes: 1 addition & 1 deletion src/environments/mario_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def interpret_state(self, state: np.ndarray) -> np.ndarray:
# Resize while preserving RGB channels
state = resize(
state,
(self.config.input_shape[0], self.config.input_shape[1], 3),
(self.config.input_shape[0], self.config.input_shape[1], self.config.input_channels),
anti_aliasing=True,
preserve_range=True
).astype(np.uint8)
Expand Down
8 changes: 4 additions & 4 deletions src/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class Config:
c2: float = 1.5
c3: float = 0.4
genomic_distance_threshold: float = 2.69
population_size: int = 40 # 56 cores on IDUN
generations: int = 2 # A bunch of iterations
population_size: int = 560 # 56 cores on IDUN
generations: int = 10 # A bunch of iterations

connection_weight_mutation_chance: float = 0.8

Expand All @@ -24,9 +24,9 @@ class Config:
# Connections should be added way more often than nodes

num_output_nodes: int = 7
input_shape: Tuple[int, int] = (20, 40)
input_shape: Tuple[int, int] = (10, 20)

input_channels: int = 3
input_channels: int = 1
"""If using RGB, value should be 3, if using grayscale, value should be 1"""
num_input_nodes: int = input_shape[0] * input_shape[1] * input_channels

Expand Down

0 comments on commit 5103964

Please sign in to comment.