add input_transform and update_input_transform;
change the args for genome.forward. Origin: (state, inputs, transformed) New: (state, transformed, inputs)
This commit is contained in:
@@ -2,7 +2,7 @@ from pipeline import Pipeline
|
||||
from algorithm.neat import *
|
||||
|
||||
from problem.func_fit import XOR3d
|
||||
from utils import Act
|
||||
from utils import ACT_ALL, AGG_ALL, Act, Agg
|
||||
|
||||
if __name__ == "__main__":
|
||||
pipeline = Pipeline(
|
||||
@@ -15,17 +15,21 @@ if __name__ == "__main__":
|
||||
max_conns=100,
|
||||
node_gene=DefaultNodeGene(
|
||||
activation_default=Act.tanh,
|
||||
activation_options=(Act.tanh,),
|
||||
# activation_options=(Act.tanh,),
|
||||
activation_options=ACT_ALL,
|
||||
aggregation_default=Agg.sum,
|
||||
# aggregation_options=(Agg.sum,),
|
||||
aggregation_options=AGG_ALL,
|
||||
),
|
||||
output_transform=Act.sigmoid, # the activation function for output node
|
||||
mutation=DefaultMutation(
|
||||
node_add=0.1,
|
||||
conn_add=0.1,
|
||||
node_delete=0.05,
|
||||
conn_delete=0.05,
|
||||
node_delete=0,
|
||||
conn_delete=0,
|
||||
),
|
||||
),
|
||||
pop_size=1000,
|
||||
pop_size=100000,
|
||||
species_size=20,
|
||||
compatibility_threshold=2,
|
||||
survival_threshold=0.01, # magic
|
||||
|
||||
@@ -16,7 +16,7 @@ if __name__ == "__main__":
|
||||
max_nodes=50,
|
||||
max_conns=100,
|
||||
node_gene=KANNode(),
|
||||
conn_gene=BSplineConn(),
|
||||
conn_gene=BSplineConn(grid_cnt=10),
|
||||
output_transform=Act.sigmoid, # the activation function for output node
|
||||
mutation=DefaultMutation(
|
||||
node_add=0.1,
|
||||
@@ -25,7 +25,7 @@ if __name__ == "__main__":
|
||||
conn_delete=0.05,
|
||||
),
|
||||
),
|
||||
pop_size=1000,
|
||||
pop_size=10000,
|
||||
species_size=20,
|
||||
compatibility_threshold=1.5,
|
||||
survival_threshold=0.01, # magic
|
||||
@@ -34,7 +34,7 @@ if __name__ == "__main__":
|
||||
# problem=XOR3d(return_data=True),
|
||||
problem=XOR3d(),
|
||||
generation_limit=10000,
|
||||
fitness_target=-1e-8,
|
||||
fitness_target=-1e-5,
|
||||
# update_batch_size=8,
|
||||
# pre_update=True,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user