Skip to content

Commit 5f4ff89

Browse files
author
Yoshua Bengio
committed
removed unnecessary cast of learning rate into numpy array
1 parent 459dbe6 commit 5f4ff89

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

doc/logreg.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ follows:
271271
learning_rate=0.01
272272

273273
# specify how to update the parameters of the model as a dictionary
274-
updates ={classifier.W: classifier.W - numpy.asarray(learning_rate)*g_W,\
275-
classifier.b: classifier.b - numpy.asarray(learning_rate)*g_b}
274+
updates ={classifier.W: classifier.W - learning_rate*g_W,\
275+
classifier.b: classifier.b - learning_rate*g_b}
276276

277277
# compiling a Theano function `train_model` that returns the cost, but in
278278
# the same time updates the parameter of the model based on the rules

doc/mlp.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,10 @@ parameters differ.
204204

205205
# specify how to update the parameters of the model as a dictionary
206206
updates = \
207-
{ W1: W1 - numpy.asarray(learning_rate)*g_W1 \
208-
, b1: b1 - numpy.asarray(learning_rate)*g_b1 \
209-
, W2: W2 - numpy.asarray(learning_rate)*g_W2 \
210-
, b2: b2 - numpy.asarray(learning_rate)*g_b2 }
207+
{ W1: W1 - learning_rate*g_W1 \
208+
, b1: b1 - learning_rate*g_b1 \
209+
, W2: W2 - learning_rate*g_W2 \
210+
, b2: b2 - learning_rate*g_b2 }
211211

212212
# compiling a theano function `train_model` that returns the cost, but
213213
# in the same time updates the parameter of the model based on the rules

0 commit comments

Comments
 (0)