Returns a new crop resize layer.
- Parameter coordinatesAreNormalized: A Boolean value that specifies whether the
bounding box coordinates are normalized to (0, 1)
- Parameter spatialScale: An additional spatial scale that multiplies the bounding
box coordinates.
- Parameter extrapolationValue: A value that the layer uses for extrapolation, when
applicable. Default to zero.
- Parameter samplingMode: The sampling mode that the layer uses to select sample points.
- Parameter boxCoordinateMode: A structure that specifies the convention for
specifying the four bounding box coordinates.
- seealso: `BNNSLayerParametersCropResize`
This initializer creates a layer that uses bilinear interpolation.
This `samplingMode` parameter controls how the grid is sampled. If the input grid is
`[0, Xin-1]` (corresponding to an input size of `Xin`), and if the output size is `Xout`,
the layer samples grid points are sampled in the following manner:
* `.default`:
* spacing = `(Xin - Xin/Xout) / (Xout - 1)`,
* `grid_point[i] = min(Xin-1, max(0, i*spacing)), for i=0,1,...,Xout-1`
* `alignCorners`: The same as `.strictAlignCorners` unless `unless Xout=1` in which case:
* `grid_point[0] = (Xin-1) / 2, if Xout==1`
* `unalignCorners`:
* `spacing = Xin / Xout`
* `grid_point[i] = min(Xin - 1, max(0, i*spacing + 0.5*spacing - 0.5)), for i=0,1,...,Xout-1`
* `strictAlignCorners`:
* `spacing = (Xin - 1) / (Xout - 1)`
* `grid_point[i] = min(Xin-1, max(0, i*spacing)), for i=0,1,...,Xout-1`
* `offsetCorners`:
* `delta = max(1, Xin - 1) / Xout`
* `spacing = ((Xout - 1) * delta) / (Xout - 1)`
* `grid_point[i] = min(Xin-1, max(0, 0.5*delta + i*spacing)), for i=0,1,...,Xout-1`