Multi-layer perceptrons for classification - Implementing a classifier in TensorFlow.js
Implementation of a multi layer perceptron that can classify digits (hand written number) of the famous MNIST dataset right in your web browser.
Key things: transforming images to Tensors, and understanding the new outputs of the model.
- Import the training data (input and output)
- Set our Input and output tensor (shuffle the training data if need be)
- Create the model architecture:
- set the model to be sequential
- Add all the layers (neurons including hidden, output) wit their input shapes?, units "output" and activation function
- Train the model by:
- Compile the model with optimizer, loss function, metrics
- Fit and get the result from the training which takes 3 parameters: Input_tensor, output_tensor and an object that contains shuffle, validationSplit, batchSize, epoch
- Dispose all the tensors created
- Evaluate the model