O'Reilly logo

Deep Learning By Example by Ahmed Menshawy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Data analysis and preprocessing

For this task, we will be using SVHN dataset, which is an abbreviation for Street View House Numbers by Stanford (http://ufldl.stanford.edu/housenumbers/). So, let's start the implementation by importing the required packages for this implementation:

# Lets start by loading the necessary libraries%matplotlib inlineimport pickle as pklimport timeimport matplotlib.pyplot as pltimport numpy as npfrom scipy.io import loadmatimport tensorflow as tfimport os

Next up, we are going to define a helper class to download the SVHN dataset (remember that you need to manually create the input_data_dir first):

from urllib.request import urlretrievefrom os.path import isfile, isdirfrom tqdm import tqdminput_data_dir = 'input/' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required