Convolutional Neural Network

This is a use case of DEATF where a CNN and a MLP are combined with that order in a sequential way.

This is a classification problem with fashion MNIST dataset. As the first component of the network is a CNN, the input data (clothes’ images) can be directly passed and the output of the MLP is the result of the classification.

cnn_class.eval_cnn(nets, train_inputs, train_outputs, batch_size, iters, test_inputs, test_outputs, hypers)

The model that will evaluate the data is formed by a CNN and then the MLP. Between those subnetwork, a flatten layer and a dense layer are added in order to enable the union. 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.