How to do it...

We proceed with the recipe as follows:

  1. 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
  1. 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)
  1. 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))) ...

Get TensorFlow 1.x Deep Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.