maxPooling = (curLayer) => {
  console.assert(curLayer[0].type === 'pool', 'Wrong layer type');

  // Itereate through all nodes in curLayer to update their outputs
  for (let i = 0; i < curLayer.length; i++) {
    let curNode = curLayer[i];
    let preNode = curNode.inputLinks[0].source;
    curNode.output = singleMaxPooling(preNode.output);
  }
}
Max pooling one layer.
@param {[Node]} curLayer MaxPool layer