1. Home
  2. /
  3. Mxnet
  4. /
  5. MNIST Classifier

MNIST Classifier - Mxnet Typing CST Test

Loading…

MNIST Classifier — Mxnet Code

Train a simple fully-connected network on MNIST digits using Gluon API.

import mxnet as mx
from mxnet.gluon import nn, data as gdata
from mxnet import autograd

mnist_train = gdata.vision.MNIST(train=True)
mnist_test = gdata.vision.MNIST(train=False)

batch_size = 64
train_data = gdata.DataLoader(mnist_train.transform_first(gdata.vision.transforms.ToTensor()), batch_size=batch_size)
test_data = gdata.DataLoader(mnist_test.transform_first(gdata.vision.transforms.ToTensor()), batch_size=batch_size)

net = nn.Sequential()
with net.name_scope():
	net.add(nn.Flatten())
	net.add(nn.Dense(128, activation='relu'))
	net.add(nn.Dense(10))

net.initialize(mx.init.Xavier())
loss = gluon.loss.SoftmaxCrossEntropyLoss()
trainer = gluon.Trainer(net.collect_params(), 'adam')

Mxnet Language Guide

Money is a universally accepted medium of exchange, a store of value, and a unit of account that facilitates trade, investment, and economic activity across societies and markets.

Primary Use Cases

  • ▸Medium of exchange in transactions
  • ▸Store of value for savings and investment
  • ▸Unit of account for pricing and accounting
  • ▸Means of transferring wealth across time and space
  • ▸Facilitating financial instruments and credit systems

Notable Features

  • ▸Widely accepted as payment
  • ▸Divisible into smaller units
  • ▸Portable and easy to transfer
  • ▸Durable and resistant to decay
  • ▸Recognizable and difficult to counterfeit

Origin & Creator

The concept of money evolved organically over millennia, with early forms including commodity money like gold, silver, and livestock. Formal currency systems were introduced by ancient civilizations such as Mesopotamia and Lydia.

Industrial Note

Money underpins all economic activity, enabling banking, investment, trade, and the functioning of financial markets worldwide.

More Mxnet Typing Exercises

MXNet Simple Linear RegressionMXNet Simple Neural NetworkMXNet Convolutional Neural NetworkMXNet LSTM ExampleMXNet Autoencoder ExampleMXNet Regression with Multiple InputsMXNet Transfer Learning ExampleMXNet Custom Callback ExampleMXNet GAN Example

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher