Skip to content

nileshpatra/linear-regression-simulation-using-tensorflow.js

Repository files navigation

SIMULATION USING TF.JS:

Build Status

  • This repository is supposed to train the model and plot the best fit line using tensorflow Utilities :
    • p5.js
    • tf.js

Steps :
---1. PREPROCESSING DATA---

  • Included the online hosted js files from official sites
  • Hosted from https://js.tensorflow.org and https://p5js.org and included int script
  • made a function to record coordinated of mouseclick and add in the data
  • also created a dot of show the clicked point

---2. INITIALIZING BIAS AND WEIGHT , CREATING PREDICT FUNCTION---

  • created tensorflow variables m and b with random values between 0 and 1
  • made predict function using the basic formula y = m*x + c

---3. TRAINING AND GETTING VALUES---

  • used adam optimizer and passed the predict fuunction to minimize loss
  • the model is trained using the neural network with tfjs
  • plotted a line with the given slope and bias , reflected it in the canvas
  • also referred www.thecodingtrain.com to build this

---HERE IS HOW THE MODEL WORKS IN ACTION--:


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published