Subsampling Operators

ScatteringTransform.RationPoolType
RationPool{A,B}

An extension of Flux's MaxPool and MeanPool to subsampling by rational amounts as well. Don't construct directly. Has fields r.m, which is the pooling operator as implemented in Flux, and r.resSize, which gives the subsampling rates, either as Integer, Rational, or tuples of these.

It works by first applying the given pooling operator, but with a step size of 1, and then keeping p out of q entries, where p is the numerator of the rational rate, and q is the denominator.

source
ScatteringTransform.RationPoolMethod
RationPool(resSize, k=2; nExtraDims=1, poolType = MeanPool)

Construct a RationPool instance, which is a slight extension of the Flux pooling methods to subsample at a rational rate resSize, which can vary by channel. For example, for a 2D input, resSize could be (2,3//2), 3//2 (equivalent to (3//2, 3//2)), or (5//3, 5//3).

k is the window size of the pooling, and poolType is the type of pooling, either MaxPool or MeanPool. nExtraDims counts the number of dimensions uninvolved in the convolution; normally this is 2, as in (..., nChannels, nExamples). You can expect pooling to work for sizes up to 5 total dimensions.

source

Subsampling Utilities

ScatteringTransform.poolSizeFunction
poolSize(k::RationPool, sizes)
poolSize(k, sizs)

Return the number should we expect in the output with pooling rates k in each dimension (e.g. (3//2, 3//2) or RationPool((3//2,3//2))).

source