Skip to content

Commit 4aaaeb1

Browse files
committed
Merge pull request lisa-lab#40 from nouiz/master
Fix math and update timming
2 parents f33631b + fef6057 commit 4aaaeb1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Diff for: code/test.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ def speed():
7777
# 580 for the GPU. OS=Fedora 14, gcc=4.5.1, python/BLAS from EPD
7878
# 7.1-2 (python 2.7.2, mkl unknow). BLAS with only 1 thread.
7979

80-
expected_times_64 = numpy.asarray([10.0, 22.5, 76.1, 73.7, 116.4,
80+
expected_times_64 = numpy.asarray([9.8, 22.5, 76.1, 73.7, 116.4,
8181
346.9, 381.9, 558.1, 186.3])
82-
expected_times_32 = numpy.asarray([11.6, 29.6, 42.5, 66.5, 71,
82+
expected_times_32 = numpy.asarray([8.1, 17.9, 42.5, 66.5, 71,
8383
191.2, 226.8, 432.8, 176.2])
8484

8585
# Number with just 1 decimal are new value that are faster with
@@ -219,6 +219,7 @@ def do_tests():
219219
print >> sys.stderr, 'gpu % expected/get', (
220220
expected_times_gpu / gpu_times)
221221

222+
print
222223
if do_float64 and do_float32:
223224
print >> sys.stderr, 'float64/float32', (
224225
float64_times / float32_times)
@@ -239,6 +240,7 @@ def compare(x, y):
239240
# time and the real time, we consider this an error.
240241
return sum((ratio < 0.95) + (ratio > 1.05))
241242

243+
print
242244
if do_float64:
243245
err = compare(expected_times_64, float64_times)
244246
print >> sys.stderr, 'speed_failure_float64=' + str(err)

Diff for: doc/lenet.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ feature map :math:`h^k` is obtained as follows (for :math:`tanh` non-linearities
139139

140140
.. Note::
141141
Recall the following definition of convolution for a 1D signal.
142-
:math:`o[n] = f[n]*g[n] = \sum_{u=-\infty}^{\infty} f[u] g[u-n] = \sum_{u=-\infty}^{\infty} f[n-u] g[u]`.
142+
:math:`o[n] = f[n]*g[n] = \sum_{u=-\infty}^{\infty} f[u] g[n-u] = \sum_{u=-\infty}^{\infty} f[n-u] g[u]`.
143143

144144
This can be extended to 2D as follows:
145-
:math:`o[m,n] = f[m,n]*g[m,n] = \sum_{u=-\infty}^{\infty} \sum_{v=-\infty}^{\infty} f[u,v] g[u-m,v-n]`.
145+
:math:`o[m,n] = f[m,n]*g[m,n] = \sum_{u=-\infty}^{\infty} \sum_{v=-\infty}^{\infty} f[u,v] g[m-u,n-v]`.
146146

147147
To form a richer representation of the data, hidden layers are composed of
148148
a set of multiple feature maps, :math:`\{h^{(k)}, k=0..K\}`.

0 commit comments

Comments
 (0)