Sequential Network

This is a use case of DEATF where a sequential combination of two networks is used.

The two networks that are combined in a sequential way are two MLPs. This is a classification problem with fashion MNIST dataset. Due to the two dimensions of the input data, it has to be flattened in order to pass it to the MLPs; but the rest is similar to other classification examples in this library.

sequential.eval_sequential(nets, train_inputs, train_outputs, batch_size, iters, test_inputs, test_outputs, hypers)

The model that will evaluate the data is formed by a MLP and then other MLP. As they are compatible between them, there is no need of extra layers between them. Softmax cross entropy is used for the training and accuracy error for evaluating the network.

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

Accuracy error obtained with the test data that evaluates the true performance of the network.