Skip to content

Commit 226729f

Browse files
committed
all fixes suggested by Pascal, plus update for the doc
1 parent 2c610d3 commit 226729f

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

code/SdA.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,7 @@ def test_SdA(finetune_lr=0.1, pretraining_epochs=15,
394394
c.append(pretraining_fns[i](index=batch_index,
395395
corruption=corruption_levels[i],
396396
lr=pretrain_lr))
397-
print('Pre-training layer %i, epoch %d, cost ' % (i, epoch))
398-
print(numpy.mean(c))
397+
print('Pre-training layer %i, epoch %d, cost %f' % (i, epoch, numpy.mean(c)))
399398

400399
end_time = timeit.default_timer()
401400

code/lstm.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from six.moves import xrange
77
import six.moves.cPickle as pickle
88

9-
#from six.moves.collections import OrderedDict
109
from collections import OrderedDict
1110
import sys
1211
import time

code/rnnslu.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ def main(param=None):
333333
for i, (x, y) in enumerate(zip(train_lex, train_y)):
334334
rnn.train(x, y, param['win'], param['clr'])
335335
print('[learning] epoch %i >> %2.2f%%' % (
336-
e, (i + 1) * 100. / nsentences),)
337-
print('completed in %.2f (sec) <<\r' % (timeit.default_timer() - tic),)
336+
e, (i + 1) * 100. / nsentences), end=' ')
337+
print('completed in %.2f (sec) <<\r' % (timeit.default_timer() - tic), end='')
338338
sys.stdout.flush()
339339

340340
# evaluation // back into the real world : idx -> words
@@ -393,10 +393,10 @@ def main(param=None):
393393
if param['clr'] < 1e-5:
394394
break
395395

396-
print(('BEST RESULT: epoch', param['be'],
396+
print('BEST RESULT: epoch', param['be'],
397397
'valid F1', param['vf1'],
398398
'best test F1', param['tf1'],
399-
'with the model', folder))
399+
'with the model', folder)
400400

401401

402402
if __name__ == '__main__':

doc/index.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,6 @@ Energy-based recurrent neural network (RNN-RBM):
6363
.. _Theano basic tutorial: http://deeplearning.net/software/theano/tutorial
6464

6565
.. _Contractive auto-encoders: https://github.com/lisa-lab/DeepLearningTutorials/blob/master/code/cA.py
66+
67+
Note that the tutorials here are all compatible with Python 2 and 3, with the exception of :ref:`rnnrbm` which is only available for Python 2.
68+

0 commit comments

Comments
 (0)