So there are still things that are demystifying and as a beginner we are stuck to the keras semantics. Coz keras is simple and great for beginners or if you are working with DL. Things get easy like transfer learning, creating a architecture without thinking much, using the ImageDateGenerator.

We are here to use tensorflow to create a very low level tensorflow code to create a linear regression model. And also we’ll also be crafting our own data so we know where it must eventually go (It’s just kept for a hands on easy tutorial). If you wish you can use your own data.

Let’s start by importing the main libraries that we will be requiring. And that’s just tensorflow for the model and numpy for generating our data and matplotlib to visualise our model in action.

`import tensorflow as tf `

import numpy as np

import matplotlib.pyplot as plt

Now let’s create the data:

`X = tf.constant(np.linspace(0, 2, 2000), dtype=tf.float32)`

Y = X * tf.exp(-X**2) #finding exponential

In the above code we are creating 2 tensorflow constants. And if you are not know about tensorflow constants then they are just like numpy array whose values cannot be modified. Or more specifically if you know about pandas series then its the same (values, rank, shape and dtype). Inside tf.constant() we are creating a numpy array of 2000 values ranging between 0 and 200 and then defining the type of the tensorflow constant to be float32.

You can visualize X and Y if you like to.

`plt.plot(X, Y)`

plt.show()