XOR Environment¶
Overview¶
The XOR problem is a classic problem in ML research and particularly relevant for research in Neuroevolution, as it is a very simple problem that nonetheless can only be solved if an applied ANN features hidden nodes. The XOR problem measures an ANNs ability to reproduce the XOR function, which takes 2 binary inputs and produces 1 binary output according to the following truth table:
A_in |
B_in |
out |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
0 |
This function can not be replicated by a minimal topology graph when attempting to learn the associations purely by training the associated weights and biases. It therefore requires an additional hidden node in the topology graph and is therefore particularly interesting for the research of neuroevolution algorithms and their ability to generate novel and beneficial topological structures. See the figure below for the most efficient topological mutation when starting from a minimal topology.
Specifications¶
Supports Weight-Training Eval |
True |
Supports Non-Weight-Training Eval |
True |
Input Shape |
(2,) |
required Output Shape |
(1,) |
The fitness is calculated as the inverse cross-entropy loss between the actual and the predicted outputs, multiplied by 100 to get the degree of accuracy in percent.
[EVALUATION] Config Parameters¶
Weight-Training Evaluation¶
epochs
Value Range: int > 0
Description: Specifies the amount of epochs a genome phenotype is to be trained on the environment before evaluating its fitness.
batch_size
Value Range: int > 0 | None
Description: Supplied batch_size value for the model.fit function. batch_size is the number of training examples used for a single iteration of backpropagating the gradient of the loss function.
Non-Weight-Training Evaluation¶
None