remove create_func....

This commit is contained in:
wls2002
2023-08-02 13:26:01 +08:00
parent 85318f98f3
commit 1499e062fe
34 changed files with 558 additions and 1022 deletions

View File

@@ -3,7 +3,8 @@ import numpy as np
from config import Config, BasicConfig, NeatConfig
from pipeline import Pipeline
from algorithm import NEAT, NormalGene, NormalGeneConfig
from algorithm import NEAT
from algorithm.neat.gene import NormalGene, NormalGeneConfig
xor_inputs = np.array([[0, 0], [0, 1], [1, 0], [1, 1]], dtype=np.float32)
xor_outputs = np.array([[0], [1], [1], [0]], dtype=np.float32)
@@ -23,15 +24,15 @@ def evaluate(forward_func):
if __name__ == '__main__':
config = Config(
basic=BasicConfig(
fitness_target=3.99999,
fitness_target=3.9999999,
pop_size=10000
),
neat=NeatConfig(
maximum_nodes=20,
maximum_conns=50,
),
gene=NormalGeneConfig()
)
)
algorithm = NEAT(config, NormalGene)
normal_gene = NormalGene(NormalGeneConfig())
algorithm = NEAT(config, normal_gene)
pipeline = Pipeline(config, algorithm)
pipeline.auto_run(evaluate)