xrange() was removed in Python 3, use range() instead
@@ -148,7 +148,7 @@ def OrthogonalInit(rng, sizeX, sizeY, sparsity=-1, scale=1):
sparsity = numpy.minimum(sizeY, sparsity)
values = numpy.zeros((sizeX, sizeY), dtype=theano.config.floatX)
- for dx in xrange(sizeX):
+ for dx in range(sizeX):
perm = rng.permutation(sizeY)
new_vals = rng.normal(loc=0, scale=scale, size=(sparsity,))
values[dx, perm[:sparsity]] = new_vals
@@ -187,7 +187,7 @@ def NormalInit(rng, sizeX, sizeY, scale=0.01, sparsity=-1):
sparsity = numpy.minimum(sizeY, sparsity)
values = numpy.zeros((sizeX, sizeY), dtype=theano.config.floatX)
- for dx in xrange(sizeX):
+ for dx in range(sizeX):
perm = rng.permutation(sizeY)
new_vals = rng.normal(loc=0, scale=scale, size=(sparsity,))
values[dx, perm[:sparsity]] = new_vals
