going through the TensorFlow with neural networks, and I tried to build a linear model with house price data set from Kaggle, where I took two inputs and assigned the sales price as the target variable.
when I tried training the model with 100 iterations with the learning rate 0.02 initially, it gave me iterative values for the first 10 instances and started giving me infinity values and then Nan.
I even tried tweaking the learning rate and the iteration value to 10
but still, I got a non-linear graph for the model which is unlikely.
Start your code here
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
for i in range(10):
loss=np.sum(deltas ** 2)/2/observations
Link for the dataset used:
The reason for that is that your loss function is not converging to 0, but rather – diverging to infinity.
This usually happens when the learning rate you have chosen is too big. Please try with some lower number, e.g. 0.0001.
The 365 Team