This commit is contained in:
wls2002
2024-06-20 16:32:52 +08:00
parent 9f72813c35
commit 075460f896
17 changed files with 224 additions and 140 deletions

View File

@@ -8,7 +8,7 @@ if __name__ == "__main__":
pipeline = Pipeline(
algorithm=NEAT(
species=DefaultSpecies(
genome=DefaultGenome(
genome=DenseInitialize(
num_inputs=3,
num_outputs=1,
max_nodes=50,
@@ -21,7 +21,7 @@ if __name__ == "__main__":
# aggregation_options=(Agg.sum,),
aggregation_options=AGG_ALL,
),
output_transform=Act.sigmoid, # the activation function for output node
output_transform=Act.standard_sigmoid, # the activation function for output node
mutation=DefaultMutation(
node_add=0.1,
conn_add=0.1,
@@ -29,7 +29,7 @@ if __name__ == "__main__":
conn_delete=0,
),
),
pop_size=100000,
pop_size=10000,
species_size=20,
compatibility_threshold=2,
survival_threshold=0.01, # magic
@@ -37,7 +37,7 @@ if __name__ == "__main__":
),
problem=XOR3d(),
generation_limit=10000,
fitness_target=-1e-8,
fitness_target=-1e-3,
)
# initialize state