Coding Challenge #104: Linear Regression with TensorFlow.js
In this challenge, I use the TensorFlow.js library to create an interactive demonstration of linear regression (with stochastic gradient descent!) Code: https://thecodingtrain.com/challenges/104-linear-regression-with-tensorflowjs
πΉοΈ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/UtOWCSYYF
π₯ Previous video: https://youtu.be/X0kjv0MozuY?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Next video: https://youtu.be/tIXDik5SGsI?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
πΎ TensorFlow.js: https://js.tensorflow.org/
π¦ Kaustubh Olpadkar's tweet: https://twitter.com/olpadkar/status/997836558131650561
Videos:
π Linear Regression with Gradient Descent: https://youtu.be/L-Lsfu4ab74
π TensorFlow.js playlist: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6YIeVA3dNxbR9PYj4wV31oQ
π Intelligence and Learning playlist: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6YJ3XfHhT2Mm4Y5I99nrIKX
π ES6 Arrow Function: https://www.youtube.com/watch?v=mrYMzpbFz18
π JavaScript Promises: https://www.youtube.com/watch?v=QO4NXhWo_NM&list=PLRqwX-V7Uu6bKLPQvPRNNE65kBL62mVfx
Live Stream Archive:
π΄ Coding Train Live 139: https://youtu.be/NZR-N_dhK2M?t=473s
Related Coding Challenges:
π #70 Nearest Neighbors Recommendation Engine: https://youtu.be/N8Fabn1om2k
π #105 Polynomial Regression with TensorFlow.js: https://youtu.be/tIXDik5SGsI
π #106 XOR Problem with TensorFlow.js: https://youtu.be/N3ZnNa01BPM
Timestamps:
0:00 Introduction
1:21 What is linear regression?
3:16 What do we need?
3:41 Loss function
4:48 Optimizer
5:26 Formula for line
8:02 Let's Code!
8:23 Add data set -- mouse clicks
9:16 Remap x, y to 0, 1
12:12 Randomly initialize m and b
13:10 tf.variable()
13:39 predict()
16:13 Optimizer & learning rate
17:25 Loss function
19:24 Minimize loss
22:53 What is the optimizer doing?
27:42 Visualize regression results
32.49 dataSync()
35:00 Adjust learning rate
35:35 Memory management
41:01 Improvements
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
π Website: http://thecodingtrain.com/
πΎ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
π© Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
π‘ GitHub: https://github.com/CodingTrain
π¬ Discord: https://thecodingtrain.com/discord
π Membership: http://youtube.com/thecodingtrain/join
π Store: https://standard.tv/codingtrain
ποΈ Twitter: https://twitter.com/thecodingtrain
πΈ Instagram: https://www.instagram.com/the.coding.train/
π₯ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π p5.js: https://p5js.org
π p5.js Web Editor: https://editor.p5js.org/
π Processing: https://processing.org
π Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new
#tensorflowjs #linearregression #stochasticgradientdescent #p5js #tensorflowjs