TransposeLayer
represents a net layer that transposes the first two levels of its input.
TransposeLayer[mn]
represents a net layer that transposes levels m and n of its input.
TransposeLayer[{m1n1,m2n2,…}]
represents a net layer that sequentially transposes levels mi and ni of its input.
TransposeLayer[{n1,n2,…}]
represents a net layer such that the k level of the input is the nk level in the output.
Details and Options
- TransposeLayer[] is equivalent to TransposeLayer[12].
- When applied to an input of dimensions {d1,…,dm,…,dn,…}, TransposeLayer[mn] will produce an output of dimensions {d1,…,dn,…,dm,…}.
- TransposeLayer[…][input] explicitly computes the output from applying the layer to input.
- TransposeLayer[…][{input1,input2,…}] explicitly computes an output for each of the inputi.
- When given a NumericArray as input, the output will be a NumericArray.
- TransposeLayer exposes the following ports for use in NetGraph etc.:
-
"Input" an array "Output" an array - TransposeLayer is typically used inside NetChain, NetGraph, etc.
- TransposeLayer normally infers the dimensions of its input from its context in NetChain etc. To specify the dimensions explicitly as {n1,n2,…}, use TransposeLayer["Input"{n1,n2,…}].
- Options[TransposeLayer] gives the list of default options to construct the layer. Options[TransposeLayer[…]] gives the list of default options to evaluate the layer on some data.
- Information[TransposeLayer[…]] gives a report about the layer.
- Information[TransposeLayer[…],prop] gives the value of the property prop of TransposeLayer[…]. Possible properties are the same as for NetGraph.
Examples
open allclose allBasic Examples (2)
Create a TransposeLayer:
Create a TransposeLayer that takes a matrix as input:
Scope (6)
Arguments (1)
Create a TransposeLayer that transposes the first and third dimensions of an input array:
Ports (5)
Create a TransposeLayer that takes a matrix as input:
The layer threads across a batch of examples:
Create a TransposeLayer that swap axis 1 with axis 3 and axis 2 with axis 4:
Apply the layer to a 3×4×5×6 array to produce a 5×6×3×4 array:
Create a TransposeLayer that swaps axes 1 and 3 and subsequently swaps axes 1 and 4:
Apply the layer to a 3×4×5×6 array to produce a 6×4×3×5 array:
Create a TransposeLayer that swaps axes with given permutations:
Create a TransposeLayer with partially specified input size that swaps axes with given permutations:
Properties & Relations (0)
Possible Issues (1)
TransposeLayer cannot accept symbolic inputs:
Text
Wolfram Research (2017), TransposeLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/TransposeLayer.html (updated 2021).
CMS
Wolfram Language. 2017. "TransposeLayer." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/TransposeLayer.html.
APA
Wolfram Language. (2017). TransposeLayer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TransposeLayer.html