Weighted Neural Network¶
This is a use case of DEATF where a weighted artificial neural network (WANN) is used.
This is a case like the simple.py example because only one MLP is used to solve the problem. The difference is that here the weights are not randomly initialized, they are loaded to the model like hyperparameters and as hyperparameters they are evolved. So is an aproach of weight evolving. This is a classification problem, but in order to simplify it it has be turned into a binary classification problem.
-
wann.eval_wann(nets, train_inputs, train_outputs, batch_size, iters, test_inputs, test_outputs, hypers)¶ This evaluation case is different to the ones in the other examples and not because of the model’s building. The difference is that the weigths are loaded into the model and this implies that it do not need to train, once the weights are loaded the model can predict. In orddr to evaluate the performance it is used the mean of the cases that have been well predicted.
- Parameters
nets – Dictionary with the networks that will be used to build the final network and that represent the individuals to be evaluated in the genetic algorithm.
train_inputs – Input data for training, this data will only be used to give it to the created networks and train them.
train_outputs – Output data for training, it will be used to compare the returned values by the networks and see their performance.
batch_size – Number of samples per batch are used during training process.
iters – Number of iterations that each network will be trained.
test_inputs – Input data for testing, this data will only be used to give it to the created networks and test them. It can not be used during training in order to get a real feedback.
test_outputs – Output data for testing, it will be used to compare the returned values by the networks and see their real performance.
hypers – Hyperparameters that are being evolved and used in the process.
- Returns
Mean of the cases that have been well predicted that evaluates the true performance of the network.