TransWikia.com

NEAT can't solve XOR completely

Artificial Intelligence Asked by Creepsy on August 24, 2021

I’m currently implementing the NEAT algorithm. But problems occur when testing it with problems which don’t have a linear solution(for example xor). My xor only produces 3 correct outputs once at a time:

1, 0 -> 0.99
0, 0 -> 0
1, 1 -> 0
0, 1 -> 0

My genome class works fine, so I guess that the problem occurs on breeding or that my config is wrong.

Config

const size_t population_size = 150;
const size_t inputs = 3 (2 inputs + bias);
const size_t outputs = 1;
double compatibility_threshold = 3;
double steps = 0.01;
double perturb_weight = 0.9;
double mutate_connection = 0.05;
double mutate_node = 0.03;
double mutate_weights = 0.8;
double mutate_disable = 0.1;
double mutate_enable = 0.2;
double c_excess = 1;
double c_disjoint = 1;
double c_weight = 0.4;
double crossover_chance = 0.75;

Does anyone has an idea what the problem might be? I proof read my code multiple times, but wasnt able the figure it out.

Here is the github link to my code(not documented): click

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP