Skip to content

Instantly share code, notes, and snippets.

View SuvroBaner's full-sized avatar
🏠
Working from home

Suvro Banerjee SuvroBaner

🏠
Working from home
View GitHub Profile
def model(X_train, Y_train, X_test, Y_test, learning_rate = 0.0001, num_epochs = 1500, minibatch_size = 32, print_cost = True):
"""
Implements a three-layer tensorflow neural network: LINEAR->RELU->LINEAR->RELU->LINEAR->SOFTMAX.
Returns:
parameters -- parameters learnt by the model. They can then be used to predict.
"""
ops.reset_default_graph() # to be able to rerun the model without overwriting tf variables
tf.set_random_seed(1) # to keep a consistent result
seed = 3 # to keep a consistent result, used in mini-batches
(n_x, m) = X_train.shape # n_x : input size (input features); m : num of examples in the train set