Sigmoid Neuron, RuntimeWarning: invalid value encountered in multiply/add

I am encountering this error while training my data.
I believe it is arising due to the np.dot function

class SigmoidNeuron :
  def __init__(self):
    self.w = None
    self.b = None

  def perceptron(self, x):
    return np.dot(x, self.w.T) + self.b

  def sigmoid(self,x):
    return 1.0/1.0+ np.exp(-x)

Any help shall be appreciated

Atleast the first warning can be ignored.
Can you share a link to your notebook?

here’s a link to notebook : https://colab.research.google.com/drive/1eJa-7tHq1AlQ1gxC24eBriQq4dhaaWAJ?usp=sharing
link to the data : https://drive.google.com/file/d/1rtwC_k4WA8TuGmV4hhSPDp5S4meIXBNV/view

Its not accessible, can you make the link access to all?
Screenshot 2020-07-25 at 11.49.14 PM

I think brackets are required in sigmoid function. See if this resolves the issue.

  • return 1.0/(1.0+ np.exp(-x))
2 Likes