Skip to content

Instantly share code, notes, and snippets.

@peiyunh
Last active August 27, 2016 05:47
Show Gist options
  • Save peiyunh/f14f27e11e6be01360d47ba69c466bb1 to your computer and use it in GitHub Desktop.
Save peiyunh/f14f27e11e6be01360d47ba69c466bb1 to your computer and use it in GitHub Desktop.
Fix GPU's random seed in Matlab
randSeed = 0;
rng(randSeed);
a = gpuArray(rand(1,5));
% uncomment below to fix gpu random seed
%randStream = parallel.gpu.RandStream('CombRecursive', 'Seed', randSeed);
%parallel.gpu.RandStream.setGlobalStream(randStream);
vl_nndropout(a, 'rate', 0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment