title: TypeError: unsupported operand type(s) for *: 'NoneType' and 'float' help FOR "nonlin np.dot"
body: <pre><code>import numpy as np
  
  def nonlin(x, deriv=False):
      if(deriv==True):
          return(x*(1-x))
  
          return 1/(1+np.exp (-x))
  
  x = np.array([[0,0,1],
  [0,1,1],
  [1,0,1],
  [1,1,1]])
  
  y = np.array([[0],
  [1],
  [1],
  [0]])
  
  
  #seed
  np.random.seed(1)
  
  #weights/synapses
  
  syn0 = 2*np.random.random((3,4)) - 1
  syn1 = 2*np.random.random((4,1)) - 1
  
  #training
  
  for j in range(60000):
  
  #layers (input, hidden, output)
  #not a class, just thinking of neurons this way
  #np.dot is mattrix multiplication
  L0 = x
  L1 = nonlin(np.dot(L0, syn0))
  L2 = nonlin(np.dot(L1, syn1))
  
  #backpropagation
  l2_error = y  - L2
  if (j % 10000) == 0:
      print ("Error:" + str(np.mean(np.abs(L2_error))))
  
  #calculate deltas
  L2_delta = L2_error*nonlin(L2, deriv=True)
  
  L1_error = L2_delta.dot(syn1.T)
  
  L1_delta = L1_error * nonlin(L1, deriv=True)
  
  #update our synapses
  syn1 += L1.T.dot(L2_delta)
  syn0 += L0.T.dot(L1_delta)
  
  print ("output after training")
  print (L2)
  </code></pre>
  
  <p>The error says:   "  L2 = nonlin(np.dot(L1, syn1))
  TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'" </p>
  
  <p>This is suppose to be a very basic neural network. The portion where there is an error involves adding Layer1 and syn1 as a matrix. I am not sure if I need to change L2 to a float. This is my first time working with matrixes on python.</p>