code: function(opt) {
  
      var opt = opt || {};
  
      // required
      this.sx = opt.sx; // filter size
      this.in_depth = opt.in_depth;
      this.in_sx = opt.in_sx;
      this.in_sy = opt.in_sy;
  
      // optional
      this.sy = typeof opt.sy !== 'undefined' ? opt.sy : this.sx;
      this.stride = typeof opt.stride !== 'undefined' ? opt.stride : 2;
      this.pad = typeof opt.pad !== 'undefined' ? opt.pad : 0; // amount of 0 padding to add around borders of input volume
  
      // computed
      this.out_depth = this.in_depth;
      this.out_sx = Math.floor((this.in_sx + this.pad * 2 - this.sx) / this.stride + 1);
      this.out_sy = Math.floor((this.in_sy + this.pad * 2 - this.sy) / this.stride + 1);
      this.layer_type = 'pool';
      // store switches for x,y coordinates for where the max comes from, for each output neuron
      this.switchx = global.zeros(this.out_sx*this.out_sy*this.out_depth);
      this.switchy = global.zeros(this.out_sx*this.out_sy*this.out_depth);
    }
docs: convenience