Skip to content

Latest commit

 

History

History
77 lines (68 loc) · 2.34 KB

File metadata and controls

77 lines (68 loc) · 2.34 KB
tags python,numpy,neural-network,classification,inception module,MNIST
mathjax true

Inception Module Classification

{:.caption .img} Inception Network Andrew Ng - Inception Network, Deeplearning AI

{:.caption .img} Inception Network Motivation Andrew Ng - Inception Network Motivation, Deep Learning AI

import numpy_neural_network as npnn
import npnn_datasets

model = npnn.Sequential()
model.layers = [
  npnn.Inception((28, 28, 1),
        2,
    2,  4,
    2,  4,
        2
  ),
  npnn.MaxPool(shape_in=(28, 28, 12), shape_out=(14, 14, 12), kernel_size=2),
  npnn.Inception((14, 14, 12),
        2,
    4,  6,
    4,  6,
        2
  ),
  npnn.MaxPool(shape_in=(14, 14, 16), shape_out=(7, 7, 16), kernel_size=2),
  npnn.Inception((7, 7, 16),
        2,
    6,  6,
    6,  6,
        2
  ),
  npnn.Dense((7, 7, 16), 140),
  npnn.LeakyReLU(140),
  npnn.Dense(140, 10),
  npnn.Softmax(10)
]

loss_layer = npnn.loss_layer.CrossEntropyLoss(10)
optimizer  = npnn.optimizer.Adam(alpha=1e-3)
dataset    = npnn_datasets.MNIST_28x28_2560()

optimizer.norm  = dataset.norm
optimizer.model = model
optimizer.model.chain = loss_layer

{:.w90}

MNIST Handwritten Digits Classification using an Inception Module network

{:.w90}

MNIST Handwritten Digits Classification using an Inception Module network
plot of network validation batch data target values (green) and predicted network output values (orange)