From 9e8a5ca50a8007ef5b77b7e07411fd4b1f89e554 Mon Sep 17 00:00:00 2001 From: Vuong Nguyen Date: Wed, 20 Dec 2017 17:00:59 +0700 Subject: [PATCH] Fix typo in examples/recurrent_neural_network.py --- mlfromscratch/deep_learning/layers.py | 2 +- mlfromscratch/examples/recurrent_neural_network.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mlfromscratch/deep_learning/layers.py b/mlfromscratch/deep_learning/layers.py index 10da5c29..cd737fa8 100644 --- a/mlfromscratch/deep_learning/layers.py +++ b/mlfromscratch/deep_learning/layers.py @@ -155,7 +155,7 @@ def forward_pass(self, X, training=True): for t in range(timesteps): # Input to state_t is the current input and output of previous states self.state_input[:, t] = X[:, t].dot(self.U.T) + self.states[:, t-1].dot(self.W.T) - self.states[:, t] = self.activation.function(self.state_input[:, t]) + self.states[:, t] = self.activation(self.state_input[:, t]) self.outputs[:, t] = self.states[:, t].dot(self.V.T) return self.outputs diff --git a/mlfromscratch/examples/recurrent_neural_network.py b/mlfromscratch/examples/recurrent_neural_network.py index d066d2e4..9c26d322 100644 --- a/mlfromscratch/examples/recurrent_neural_network.py +++ b/mlfromscratch/examples/recurrent_neural_network.py @@ -5,7 +5,7 @@ from mlfromscratch.deep_learning import NeuralNetwork from mlfromscratch.utils import train_test_split, to_categorical, normalize, Plot from mlfromscratch.utils import get_random_subsets, shuffle_data, accuracy_score -from mlfromscratch.deep_learning.optimizers import GradientDescent, Adam, RMSprop, Adagrad, Adadelta +from mlfromscratch.deep_learning.optimizers import StochasticGradientDescent, Adam, RMSprop, Adagrad, Adadelta from mlfromscratch.deep_learning.loss_functions import CrossEntropy from mlfromscratch.utils.misc import bar_widgets from mlfromscratch.deep_learning.layers import RNN, Activation