forked from openai/gym-http-api
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can evaluate NEAT networks in a loop
#24 #23 @nazaruka I committed this to my own new branch dev_schrum, but you can feel free to checkout that branch and edit things, or merge this into your master branch. I didn't commit this to master since I though there might be uncommitted changes on your machine (don't do that in the future). In any case, running this version of NSGAII will now show Sonic being controlled by a NEAT network. Evolution definitely doesn't work yet though. Basically, what this does is create a NEAT population, but then the network you see evaluated is just the same one over an over rather than distinct members of the population. Also, after all of the individuals are evaluated, the code crashes because the fitness objectives are still the ones that originally came with the NSGA-II code. Here is what you should do next if you think working with this would be useful (but you can mess with your own code instead of that seems more fruitful ... just do that in your own branch): 1. Add the behavior characterization tracking to this. 2. Make the evaluate method return the behavior characterization along with the fitness. If you get that far, then we can move onto more interesting stuff.
- Loading branch information
Showing
2 changed files
with
164 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
[NEAT] | ||
fitness_criterion = max | ||
fitness_threshold = 10000000 | ||
pop_size = 20 | ||
reset_on_extinction = True | ||
|
||
[DefaultGenome] | ||
# node activation options | ||
activation_default = sigmoid | ||
activation_mutate_rate = 0.05 | ||
activation_options = sigmoid gauss | ||
#abs clamped cube exp gauss hat identity inv log relu sigmoid sin softplus square tanh | ||
|
||
# node aggregation options | ||
aggregation_default = random | ||
aggregation_mutate_rate = 0.05 | ||
aggregation_options = sum product min max mean median maxabs | ||
|
||
# node bias options | ||
bias_init_mean = 0.05 | ||
bias_init_stdev = 1.0 | ||
bias_max_value = 30.0 | ||
bias_min_value = -30.0 | ||
bias_mutate_power = 0.5 | ||
bias_mutate_rate = 0.7 | ||
bias_replace_rate = 0.1 | ||
|
||
# genome compatibility options | ||
compatibility_disjoint_coefficient = 1.0 | ||
compatibility_weight_coefficient = 0.5 | ||
|
||
# connection add/remove rates | ||
conn_add_prob = 0.5 | ||
conn_delete_prob = 0.5 | ||
|
||
# connection enable options | ||
enabled_default = True | ||
enabled_mutate_rate = 0.5 | ||
|
||
feed_forward = False | ||
#initial_connection = unconnected | ||
initial_connection = partial_nodirect 0.5 | ||
|
||
# node add/remove rates | ||
node_add_prob = 0.5 | ||
node_delete_prob = 0.2 | ||
|
||
# network parameters | ||
num_hidden = 0 | ||
num_inputs = 1120 | ||
num_outputs = 12 | ||
|
||
# node response options | ||
response_init_mean = 1.0 | ||
response_init_stdev = 0.05 | ||
response_max_value = 30.0 | ||
response_min_value = -30.0 | ||
response_mutate_power = 0.1 | ||
response_mutate_rate = 0.75 | ||
response_replace_rate = 0.1 | ||
|
||
# connection weight options | ||
weight_init_mean = 0.1 | ||
weight_init_stdev = 1.0 | ||
weight_max_value = 30 | ||
weight_min_value = -30 | ||
weight_mutate_power = 0.5 | ||
weight_mutate_rate = 0.8 | ||
weight_replace_rate = 0.1 | ||
|
||
[DefaultSpeciesSet] | ||
compatibility_threshold = 2.5 | ||
|
||
[DefaultStagnation] | ||
species_fitness_func = max | ||
max_stagnation = 50 | ||
species_elitism = 0 | ||
|
||
[DefaultReproduction] | ||
elitism = 3 | ||
survival_threshold = 0.3 | ||
|
||
|