 
   int i = x * rows + y;
   int j = tx * blockDim.y + ty;
-  data[i] = (float) (data[i] > generate_rand(globalState + j));
+  data[i] = (float) (data[i] > curand_uniform(globalState + j));
   __syncthreads();
 }
 


  int i = x * rows + y;
  int j = tx * blockDim.y + ty;
  data[i] = (float) (data[i] + generate_randn(globalState + j));
  // data[i] = (float) (data[i] + curand_uniform(globalState + j));
  __syncthreads();
}


#include <curand.h>
#include <curand_kernel.h>
#define fill_bias(x) { fillLastColumnWith(x, 1.0f); }

ostream& operator << (ostream& os, const RBM_TYPE& type) {
  switch (type) {
