This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
OlderNewer