7. Computer Vision with Convolutional Neural Networks
Activity 7.01: Amending Our Model with Multiple Layers and the Use of softmax
Let's try and improve the performance of our image classification algorithm. There are many ways to improve its performance, and one of the most straightforward ways is by adding multiple ANN layers to the model, which we will learn about in this activity. We will also change the activation from sigmoid to softmax. Then, we can compare the result with that of the previous exercise. Follow these steps to complete this activity:
- Import the
numpy
library and the necessary Keras libraries and classes:# Import the Libraries from keras.models import Sequential from keras.layers import Conv2D, MaxPool2D, Flatten, Dense import numpy as np from tensorflow import random
- Now, initiate the model with the
Sequential
class:# Initiate the classifier seed = 1 np.random.seed(seed) random.set_seed(seed) classifier=Sequential()
- Add the first layer...