You think machine learning is tough?

In this thread we will go over how we can train a neural net in less than 3 minutes with only 8 lines of code.
(and no setup required)

🧵👇
👨‍💻We'll be using google collab for this exercise, it is an online IDE with free GPU support.

More about collab👇 https://twitter.com/PrasoonPratham/status/1310173969325027328?s=20
🏠We'll try to predict the relation between the number of flats of a given house and its price accordingly.
Here's the code👇
🤔Let's try to understand what is going on here

1. We import TensorFlow and Keras which are frameworks for making neural nets

2. Our Neural Net: This is where all the magic happens, for this exercise we need only one neuron.
Think of a neuron as a function that tries to determine the correct relation between the input data (number of flats) and output data(the price of the house) through trial and error

In more complex neural nets we have hundreds or even thousands of neurons connected to each other
3. Now we fit the model onto the data and repeat the process of trial and error for 500 times (aka the epochs).

4. Now we predict what will be the price of a house with 10 flats.
You can follow @PrasoonPratham.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: