ResizeLayer
ResizeLayer[{d}]
represents a layer performing one-dimensional resizing of a two-dimensional array.
ResizeLayer[{d1,…,dn}]
represents a layer performing n-dimensional resizing of a (n+1)-dimensional array.
Details and Options
- ResizeLayer is typically used inside NetChain, NetGraph, etc. to resize one or several dimensions of input arrays by resampling.
- By default or with the setting InterleavingFalse, ResizeLayer treats the first dimension as a channel dimension, which remains unchanged. With the setting InterleavingTrue, the channel dimension is taken to be the last dimension of the input and output arrays.
- 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 - The following optional parameters can be included:
-
Interleaving False whether to assume channels are interleaved Resampling Automatic resampling method "Scheme" Automatic resampling scheme - Possible explicit settings for the Resampling method include:
-
"Linear" piecewise linear interpolation "Nearest" nearest neighbor - Possible explicit settings for the "Scheme" parameter include:
-
Automatic automatic choice depending on the method "Point" point sampling "Bin" bin sampling - Settings for the "Scheme" parameter have the same meaning as those in the third argument of ArrayResample.
- The automatic choice for the "Scheme" parameter selects "Point" when Resampling is set to "Linear" and "Bin" when Resampling is set to "Nearest".
- When the Resampling method is "Nearest", only the special cases of ResizeLayer[{Scaled[m],Scaled[n],…}], where m, n, ... are positive integers, are currently implemented.
- ResizeLayer exposes the following ports:
-
"Input" an array "Output" an array of the same rank as the input - 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.
- Options[ResizeLayer] gives the list of default options to construct the layer. Options[ResizeLayer[…]] gives the list of default options to evaluate the layer on some data.
- Information[ResizeLayer[…]] gives a report about the layer.
- Information[ResizeLayer[…],prop] gives the value of the property prop of ResizeLayer[…]. Possible properties are the same as for NetGraph.
Examples
open allclose allBasic Examples (2)
Create a ResizeLayer that resizes a three-dimensional array to be of size c×8×8:
Create a ResizeLayer that resizes a matrix to be of size c×2:
Scope (2)
Arguments (1)
Create a ResizeLayer that resizes a three-dimensional array to be a specific size:
Ports (1)
Construct a ResizeLayer that preserves the height and multiplies the width of an input image by 1.5:
Options (2)
Interleaving (1)
Create a ResizeLayer with InterleavingFalse and one input channel:
Create a ResizeLayer with InterleavingTrue and one input channel:
Text
Wolfram Research (2017), ResizeLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/ResizeLayer.html (updated 2021).
CMS
Wolfram Language. 2017. "ResizeLayer." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/ResizeLayer.html.
APA
Wolfram Language. (2017). ResizeLayer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ResizeLayer.html