Hello

I keep having RuntimeWarning while running for gradient descent, the code crashes after first iteration and I can’t figure out how to fix it. Although, it works fine on JupyterNotebook.

Hello

I keep having RuntimeWarning while running for gradient descent, the code crashes after first iteration and I can’t figure out how to fix it. Although, it works fine on JupyterNotebook.

It appears there is a math error in your code. Check your implementation of the equations.

What is your alpha value, and did you normalize your dataset? You need to figure out why at iteration 0, those values were so large.

1 Like

The problem was the alpha value. It was too large to start with; making calculations start by very large values. Thanks for your time.

1 Like

The equations were all alright. it turned up to be the alpha value at this point. It was too large.

Thanks for your report.

Alpha too large causes the solution to diverge.

Fine-tune the parameters like; Alpha, zero normalization, w and b.