Coding Challenge #104: Linear Regression with TensorFlow.js

Subscribers:
1,740,000
Published on ● Video Link: https://www.youtube.com/watch?v=dLp10CFIvxI



Duration: 43:45
55,936 views
1,114


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







Tags:
tensorflow tutorial
tensorflow tutorial for beginners
tensorflow js
tensorflow basics
tensorflow example
tensor
tensorflow
machine learning
machine learning basics
machine learning tensorflow
tensorflow basics tutorial
JavaScript (Programming Language)
programming
daniel shiffman
tutorial
coding
the coding train
nature of code
artificial intelligence
itp nyu
linear regression
linear regression tensorflow
gradient descent
stochastic gradient descent