fork download
  1. from keras.models import Sequential
  2. from keras.layers import Dense, Activation
  3. def gradient_descent(X, y, learning_rate=0.01, num_iterations=100):
  4. m = len(y)
  5. theta = np.zeros(X.shape[1])
  6.  
  7. for iteration in range(num_iterations):
  8. gradients = 2/m * X.T.dot(X.dot(theta) - y)
  9. theta = theta - learning_rate * gradients
  10.  
  11. return theta
  12.  
Success #stdin #stdout 2.62s 308956KB
stdin
Standard input is empty
stdout
Standard output is empty