# ResizeLayer

ResizeLayer[{n}]

resizes a matrix of size c0×n0 to be size c0×n.

ResizeLayer[{h,w}]

resizes an array of dimensions c0×h0×w0 to be size c0×h×w.

# Details and Options  • ResizeLayer treats the first dimension as a channel dimension, which remains unchanged.
• ResizeLayer performs linear interpolation if there is one remaining dimension and bilinear interpolation if there are two remaining dimensions.
• In ResizeLayer[{d1,,dn}], any of the di can be one of the following:
•  n scale dimension to be size n Scaled[r] scale dimension to be a ratio r of the original size All leave the dimension unchanged
• ResizeLayer[][input] explicitly computes the output from applying the layer.
• ResizeLayer[][{input1,input2,}] explicitly computes outputs for each of the inputi.
• When given a NumericArray as input, the output will be a NumericArray.
• ResizeLayer is typically used inside NetChain, NetGraph, etc.
• ResizeLayer exposes the following ports for use in NetGraph etc.:
•  "Input" an array "Output" an array of the same rank as the input
• The following optional parameters can be included:
•  Resampling Automatic resampling method
• Possible explicit settings for the Resampling method include:
•  "Linear" piecewise linear interpolation "Nearest" nearest neighbor
• When the Resampling method is "Nearest", only the special cases of ResizeLayer[{Scaled[n]}] and ResizeLayer[{Scaled[n],Scaled[n]}], where n is a positive integer, are currently implemented.
• When it cannot be inferred from other layers in a larger net, the option "Input"{d1,,dn} can be used to fix the input of ResizeLayer to be an array of dimensions d1××dn.

# Examples

open all close all

## Basic Examples(2)

Create a ResizeLayer that resizes a three-dimensional array to be of size c×8×8.

 In:= Out= Create a ResizeLayer that resizes a matrix to be of size c×2.

 In:= Out= Apply the layer to an input matrix (where c is 1):

 In:= Out= ## Scope(2)

Introduced in 2017
(11.1)
|
Updated in 2017
(11.2)