Matlab is a popular tool for training and implementing neural networks. maxPooling2dLayer(2,Stride,2): The first 2 denotes a the pool size, so, it will be 2x2. If the pool size is smaller than or equal to the stride, then the pooling regions do not overlap. The size of the rectangular regions is determined by the poolSize argument of maxPoolingLayer. It can be represented as a cuboid having its length, width (dimension of the image), and height (as images generally have red, green, and blue channels). The toolbox provides a set of functions for creating, training, and evaluating CNNs. AMA Style. At training time, the layer randomly sets input elements to zero given by the dropout mask rand(size(X))