πCNNs In Browser
Notes on Implementing CNNs In The Browser
To implement our CNN based works in the Browser we need to use Tensorflow.JS π
π·ββοΈ Workflow
π Import Tensorflow.js
π·ββοΈ Create models
π©βπ« Train
π©ββοΈ Do inference
π Importing Tensorflow.js
We can import Tensorflow.js in the way below
π·ββοΈ Creating The Model
π Same as we did in Python:
π£ Decalre a Sequential object
π©βπ§ Add layers
π Compile the model
π©βπ Train (fit)
π₯ Use the model to predict
([-1.0, 0.0, 1.0, 2.0, 3.0, 4.0], [6, 1])
[-1.0, 0.0, 1.0, 2.0, 3.0, 4.0]
: Data set values
[6, 1]
: Shape of input
πβπ¨ Attention
π’ Training is a long process so that we have to do it in an asynchronous function
π©βπ» Full Code
Last updated