Skip to content

Instantly share code, notes, and snippets.

@shubham0204
Created May 27, 2019 11:59
Show Gist options
  • Save shubham0204/c107e78ebb21b87f56083ecdcbf21a47 to your computer and use it in GitHub Desktop.
Save shubham0204/c107e78ebb21b87f56083ecdcbf21a47 to your computer and use it in GitHub Desktop.
def mean_squared_error( Y , y_pred ):
return tf.reduce_mean( tf.square( y_pred - Y ) )
def mean_squared_error_deriv( Y , y_pred ):
return tf.reshape( tf.reduce_mean( 2 * ( y_pred - Y ) ) , [ 1 , 1 ] )
def h ( X , weights , bias ):
return tf.tensordot( X , weights , axes=1 ) + bias
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment