code: function() {
  
    // find an unloaded batch
    var bi = Math.floor(Math.random()*loaded_train_batches.length);
    var b = loaded_train_batches[bi];
    var k = Math.floor(Math.random()*3000); // sample within the batch
    var n = b*3000+k;
  
    // load more batches over time
    if(step_num%5000===0 && step_num>0) {
      for(var i=0;i<num_batches;i++) {
        if(!loaded[i]) {
          // load it
          load_data_batch(i);
          break; // okay for now
        }
      }
    }
  
    // fetch the appropriate row of the training image and reshape into a Vol
    var p = img_data[b].data;
    var x = new convnetjs.Vol(28,28,1,0.0);
    var W = 28*28;
    for(var i=0;i<W;i++) {
      var ix = ((W * k) + i) * 4;
      x.w[i] = p[ix]/255.0;
    }
  
    return {x:x, label:labels[n]};
  }
docs: ------------------------ BEGIN MNIST SPECIFIC STUFF ------------------------