delete useless;
append readme
This commit is contained in:
@@ -5,6 +5,7 @@ from algorithm.neat.gene import NormalGene, NormalGeneConfig
|
||||
from problem.func_fit import XOR, FuncFitConfig
|
||||
|
||||
if __name__ == '__main__':
|
||||
# running config
|
||||
config = Config(
|
||||
basic=BasicConfig(
|
||||
seed=42,
|
||||
@@ -12,13 +13,6 @@ if __name__ == '__main__':
|
||||
pop_size=10000
|
||||
),
|
||||
neat=NeatConfig(
|
||||
max_nodes=50,
|
||||
max_conns=100,
|
||||
max_species=30,
|
||||
conn_add=0.8,
|
||||
conn_delete=0,
|
||||
node_add=0.4,
|
||||
node_delete=0,
|
||||
inputs=2,
|
||||
outputs=1
|
||||
),
|
||||
@@ -27,10 +21,13 @@ if __name__ == '__main__':
|
||||
error_method='rmse'
|
||||
)
|
||||
)
|
||||
|
||||
# define algorithm: NEAT with NormalGene
|
||||
algorithm = NEAT(config, NormalGene)
|
||||
# full pipeline
|
||||
pipeline = Pipeline(config, algorithm, XOR)
|
||||
# initialize state
|
||||
state = pipeline.setup()
|
||||
pipeline.pre_compile(state)
|
||||
# run until terminate
|
||||
state, best = pipeline.auto_run(state)
|
||||
# show result
|
||||
pipeline.show(state, best)
|
||||
|
||||
Reference in New Issue
Block a user