官术网_书友最值得收藏!

Handwritten number recognition with Keras and MNIST

A typical neural network for a digit recognizer may have 784 input pixels connected to 1,000 neurons in the hidden layer, which in turn connects to 10 output targets — one for each digit. Each layer is fully connected to the layer above. A graphical representation of this network is shown as follows, where x are the inputs, h are the hidden neurons, and y are the output class variables:

In this notebook, we will build a neural network that will recognize handwritten numbers from 0-9.

The type of neural network that we are building is used in a number of real-world applications, such as recognizing phone numbers and sorting postal mail by address. To build this network, we will use the MNIST dataset.

We will begin as shown in the following code by importing all the required modules, after which the data will be loaded, and then finally building the network:

# Import Numpy, keras and MNIST data
import numpy as np
import matplotlib.pyplot as plt

from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.utils import np_utils
主站蜘蛛池模板: 手机| 卢龙县| 双柏县| 安泽县| 项城市| 五寨县| 定边县| 赤水市| 分宜县| 巩义市| 格尔木市| 仁寿县| 吉安市| 霍城县| 自贡市| 区。| 阜南县| 宜兰市| 长子县| 汉阴县| 衡水市| 新昌县| 双桥区| 延川县| 庆城县| 镇沅| 南和县| 四子王旗| 公安县| 天门市| 白山市| 昌图县| 铜鼓县| 长沙市| 信丰县| 达拉特旗| 武清区| 涞源县| 麦盖提县| 涿州市| 施甸县|