- Related Questions & Answers
- How can Tensorflow be used to visualize the flower dataset using Python?
- How can Tensorflow be used to fit the augmented data to the model?
- How can Tensorflow be used to visualize the data using Python?
- How can Tensorflow be used to load the csv data from abalone dataset?
- How can Tensorflow be used with estimators to visualize the titanic data?
- How can Tensorflow be used to predict values on the new data for the augmented data?
- How can Tensorflow be used to display sample data from abalone dataset?
- How can Tensorflow be used to standardize the flower dataset?
- How can Tensorflow be used to visualize the results of the model?
- How can Tensorflow be used with Estimators to visualize the data, and the ROC curve?
- How can Tensorflow be used to train and compile the augmented model?
- How can Tensorflow be used to display sample data from the cats and dogs input dataset?
- How can Tensorflow be used to configure the dataset for performance?
- How can Tensorflow and pre-trained model be used to visualize the data using Python?
- How can Tensorflow and pre-trained model after recompiling be used to visualize the data?

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

The augmented data can be visualized using Tensorflow and Python with the help of ‘matplotlib’ library. The images are iterated over, and plotted using ‘imshow’ method.

**Read More:**
What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?

We will use the Keras Sequential API, which is helpful in building a sequential model that is used to work with a plain stack of layers, where every layer has exactly one input tensor and one output tensor.

A neural network that contains at least one layer is known as a convolutional layer. We can use the Convolutional Neural Network to build learning model.

We are using the Google Colaboratory to run the below code. Google Colab or Colaboratory helps run Python code over the browser and requires zero configuration and free access to GPUs (Graphical Processing Units). Colaboratory has been built on top of Jupyter Notebook.

When the number of training examples is small, the model learns from noises or unwanted details from training examples. This negatively impacts the performance of the model on new examples.

Due to overfitting, the model will not be able to generalize well on the new dataset. There are many ways in which overfitting can be avoided. We will use data augmentation to overcome overfitting.

Data augmentation generates additional training data from the existing examples by augmenting them with the help of random transformations that would yield believable-looking images.

This helps expose the model to more aspects of the data, thereby helping the model generalize better. Following is an example:

print("Visualizing the augmented examples") plt.figure(figsize=(10, 10)) for images, _ in train_ds.take(1): for i in range(9): augmented_images = data_augmentation(images) ax = plt.subplot(3, 3, i + 1) plt.imshow(augmented_images[0].numpy().astype("uint8")) plt.axis("off")

Code credit −https://www.tensorflow.org/tutorials/images/classification

Visualizing the augmented examples

The above code helps visualize some augmented examples.

This is done by applying data augmentation on the same image multiple times.

The data/images is iterated over, and some of the sample images are displayed on the console.

Advertisements