Book Image

The TensorFlow Workshop

By : Matthew Moocarme, Abhranshu Bagchi, Anthony So, Anthony Maddalone
Book Image

The TensorFlow Workshop

By: Matthew Moocarme, Abhranshu Bagchi, Anthony So, Anthony Maddalone

Overview of this book

Getting to grips with tensors, deep learning, and neural networks can be intimidating and confusing for anyone, no matter their experience level. The breadth of information out there, often written at a very high level and aimed at advanced practitioners, can make getting started even more challenging. If this sounds familiar to you, The TensorFlow Workshop is here to help. Combining clear explanations, realistic examples, and plenty of hands-on practice, it’ll quickly get you up and running. You’ll start off with the basics – learning how to load data into TensorFlow, perform tensor operations, and utilize common optimizers and activation functions. As you progress, you’ll experiment with different TensorFlow development tools, including TensorBoard, TensorFlow Hub, and Google Colab, before moving on to solve regression and classification problems with sequential models. Building on this solid foundation, you’ll learn how to tune models and work with different types of neural network, getting hands-on with real-world deep learning applications such as text encoding, temperature forecasting, image augmentation, and audio processing. By the end of this deep learning book, you’ll have the skills, knowledge, and confidence to tackle your own ambitious deep learning projects with TensorFlow.
Table of Contents (13 chapters)
Preface

5. Classification Models

Activity 5.01: Building a Character Recognition Model with TensorFlow

Solution:

  1. Open a new Jupyter notebook.
  2. Import the pandas library and use pd as the alias:
    import pandas as pd
  3. Create a variable called file_url that contains the URL to the dataset:
    file_url = 'https://raw.githubusercontent.com/PacktWorkshops'\
              '/The-TensorFlow-Workshop/master/Chapter05'\
              '/dataset/letter-recognition.data'
  4. Load the dataset into a DataFrame() function called data using read_csv() method, provide the URL to the CSV file, and set header=None as the dataset doesn't provide column names. Print the first five rows using head() method.
    data = pd.read_csv(file_url, header=None)
    data.head()

    The expected output will be as follows:

    Figure 5.42: First five rows of the data

    You can see that the dataset contains 17 columns...