jussisaurio / mnist-ts

I cannot retain any math for longer than 10 seconds if I don't do something practical with it, hence this project's raison d'etre

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Neural network from scratch in TypeScript

Zero-dependency neural network trained to recognize handwritten digits from the MNIST dataset. The stored src/mnist-model.json file has an accuracy of 94.8% on the test set. The training performance is not very good. :)

Install

npm i

Download the MNIST dataset from here and extract it like so:

src/dataset/mnist_train.csv
src/dataset/mnist_test.csv

Train

npm run mnist:train <epochs> <learning_rate> <batch_size>

Retrain existing model

USE_EXISTING=true npm run mnist:train <epochs> <learning_rate> <batch_size>

Test

npm run mnist:test

About

I cannot retain any math for longer than 10 seconds if I don't do something practical with it, hence this project's raison d'etre


Languages

Language:TypeScript 100.0%