CNN Image Classification With Advanced Hyperparameter Tunning.ipynb+ +Colab
CNN Image Classification With Advanced Hyperparameter Tunning.ipynb+ +Colab
ipynb - Colab
Image Classification Using CNN with the CIFAR-10 Dataset using advanced Hyperparameter Tunning
model.add(layers.MaxPooling2D(pool_size=(2, 2)))
model.add(layers.Flatten())
# The last dense layer with 10 output units (for 10 classes of CIFAR-10 dataset)
model.add(layers.Dense(10))
return model
# Step 8: Build the model with the best Hyperparameters and train it
model = tuner.hypermodel.build(best_hps)
history = model.fit(train_images, train_labels, epochs=10, validation_data=(test_images, test_labels))
https://colab.research.google.com/drive/1R5DUEfhiL-r-IOycZfZuoi8SYi-qHJCC#scrollTo=LTmwLdH8HtoZ&printMode=true 1/3
6/1/24, 10:44 AM cifar-10-adv-hyperparameter.ipynb - Colab
plt.subplot(1, 2, 1)
plt.plot(history.history['accuracy'], label='accuracy')
plt.plot(history.history['val_accuracy'], label = 'val_accuracy')
plt.xlabel('Epoch')
plt.ylabel('Accuracy')
plt.ylim([0, 1])
plt.legend(loc='lower right')
plt.title('Training and Validation Accuracy')
plt.grid()
plt.subplot(1, 2, 2)
plt.plot(history.history['loss'], label='loss')
plt.plot(history.history['val_loss'], label = 'val_loss')
plt.xlabel('Epoch')
plt.ylabel('Loss')
plt.legend(loc='upper right')
plt.title('Training and Validation Loss')
plt.grid()
plt.show()
https://colab.research.google.com/drive/1R5DUEfhiL-r-IOycZfZuoi8SYi-qHJCC#scrollTo=LTmwLdH8HtoZ&printMode=true 2/3