DotLayer

DotLayer[]

represents a net layer that takes the dot product of two or more arrays.

Details and Options

  • DotLayer is typically used inside NetGraph.
  • The inputs of DotLayer should be arrays, and the output is effectively given by Dot[in1,in2,].
  • DotLayer[][{in1,in2,}] explicitly computes the output from applying the layer.
  • Option InputPorts can be used to specify the number, names or shapes of input ports. If InputPorts is not specified, the number of ports and their shapes are inferred from NetChain or NetGraph connectivity.
  • Besides input ports, DotLayer exposes the following ports for use in NetGraph etc.:
  • "Output"an array
  • Within a NetGraph, a DotLayer can be connected using a single edge of the form {src1,src2,}dotlayer, where dotlayer is the name or index of the DotLayer, or as multiple separate edges given in the corresponding order, as src1dotlayer,src2dotlayer,,srcndotlayer.
  • The shapes of the inputs to DotLayer should be such that the last dimension of inputi is equal to the first dimension of inputi+1.
  • When given a NumericArray as input, the output will be a NumericArray.
  • Options[DotLayer] gives the list of default options to construct the layer. Options[DotLayer[]] gives the list of default options to evaluate the layer on some data.
  • Information[DotLayer[]] gives a report about the layer.
  • Information[DotLayer[],prop] gives the value of the property prop of DotLayer[]. Possible properties are the same as for NetGraph.

Examples

open allclose all

Basic Examples  (2)

Create a DotLayer:

Apply the layer to two input vectors to produce a scalar:

Create a NetGraph that contains a DotLayer:

Apply the graph to an input:

Scope  (5)

Create a DotLayer that accepts specific sizes of input:

Take the dot product of two length-3 vectors:

Take the dot product of a 2×3 matrix and a length-3 vector:

Take the dot product of two 2×2 matrices:

Take the dot product of three 2×2 matrices:

Possible Issues  (1)

DotLayer cannot accept symbolic inputs:

Wolfram Research (2017), DotLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/DotLayer.html (updated 2018).

Text

Wolfram Research (2017), DotLayer, Wolfram Language function, https://reference.wolfram.com/language/ref/DotLayer.html (updated 2018).

BibTeX

@misc{reference.wolfram_2021_dotlayer, author="Wolfram Research", title="{DotLayer}", year="2018", howpublished="\url{https://reference.wolfram.com/language/ref/DotLayer.html}", note=[Accessed: 28-September-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_dotlayer, organization={Wolfram Research}, title={DotLayer}, year={2018}, url={https://reference.wolfram.com/language/ref/DotLayer.html}, note=[Accessed: 28-September-2021 ]}

CMS

Wolfram Language. 2017. "DotLayer." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2018. https://reference.wolfram.com/language/ref/DotLayer.html.

APA

Wolfram Language. (2017). DotLayer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DotLayer.html