Skip to Content
Machine Learning for Finance
book

Machine Learning for Finance

by James Le, Jannes Klaas
May 2019
Intermediate to advanced
456 pages
11h 38m
English
Packt Publishing
Content preview from Machine Learning for Finance

The building blocks of ConvNets in Keras

In this section, we will be building a simple ConvNet that can be used for classifying the MNIST characters, while at the same time, learning about the different pieces that make up modern ConvNets.

We can directly import the MNIST dataset from Keras by running the following code:

from keras.datasets import mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()

Our dataset contains 60,000 28x28-pixel images. MNIST characters are black and white, so the data shape usually does not include channels:

x_train.shape
out: (60000, 28, 28)

We will take a closer look at color channels later, but for now, let's expand our data dimensions to show that we only have a one-color channel. We can achieve this by running ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Machine Learning for Finance

Machine Learning for Finance

Aryan Singh
Machine Learning and Data Science Blueprints for Finance

Machine Learning and Data Science Blueprints for Finance

Hariom Tatsat, Sahil Puri, Brad Lookabaugh

Publisher Resources

ISBN: 9781789136364Supplemental Content