Inception Module Classification
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
MNIST Handwritten Digits Classification using an Inception Module network
MNIST Handwritten Digits Classification using an Inception Module network
plot of network validation batch data target values (green) and
predicted network output values (orange)