We proceed with the recipe as follows:
- We need to import the standard modules, TensorFlow, NumPy, and Pandas, for reading the .csv file, and Matplolib:
import tensorflow as tfimport numpy as npimport pandas as pdimport matplotlib.pyplot as plt
- The training, validation, and testing data is obtained using the helper functions:
X_train, Y_train = preprocess_data(train_data)X_val, Y_val = preprocess_data(val_data)X_test, Y_test = preprocess_data(test_data)
- Let us explore our data a little. We plot the mean image and find the number of images in each training, validation, and testing dataset:
# Explore Datamean_image = X_train.mean(axis=0)std_image = np.std(X_train, axis=0)print("Training Data set has {} images".format(len(X_train))) ...