Skip to content

Instantly share code, notes, and snippets.

@MarcCote
Created September 3, 2014 18:45
Show Gist options
  • Save MarcCote/1f95703c6a3e599d6229 to your computer and use it in GitHub Desktop.
Save MarcCote/1f95703c6a3e599d6229 to your computer and use it in GitHub Desktop.
Shows nstreams limitation on GPU
import theano
import numpy as np
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
theano_rng = RandomStreams(42)
# This one works fine
print np.sum(theano_rng.uniform(size=(10000, 784), dtype=theano.config.floatX, nstreams=10000).eval(), 1)
# This one produces NaN at the end
print np.sum(theano_rng.uniform(size=(10000, 784), dtype=theano.config.floatX, nstreams=10000*400).eval(), 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment