 DeepLearning/Tensor/CrossProduct - Maple Programming Help

Home : Support : Online Help : Programming : DeepLearning Package : Tensors : Matrix Operations on Tensors : DeepLearning/Tensor/CrossProduct

DeepLearning/Tensor/CrossProduct

compute cross product of Tensors

DeepLearning/Tensor/DotProduct

compute dot product of Tensors

 Calling Sequence CrossProduct(x,y,opts) DotProduct(x,y,opts)

Parameters

 x - Tensor y - Tensor opts - zero or more options as specified below

Options

 • name=string

The value of option name specifies an optional name for this Tensor, to be displayed in output and when visualizing the dataflow graph.

Description

 • The CrossProduct(x,y,opts) command computes the cross product of two Tensor objects.
 • The DotProduct(x,y,opts) command computes the dot product of two Tensor objects.

Examples

 > $\mathrm{with}\left(\mathrm{DeepLearning}\right):$
 > $\mathrm{v1}≔\mathrm{Constant}\left(⟨-35.0,65.0,41.0⟩\right)$
 ${\mathrm{v1}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Const:0}}\\ {\mathrm{Shape: \left[3\right]}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (1)
 > $\mathrm{v2}≔\mathrm{Constant}\left(⟨-14.0,45.0,24.0⟩\right)$
 ${\mathrm{v2}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Const_1:0}}\\ {\mathrm{Shape: \left[3\right]}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (2)
 > $\mathrm{value}\left(\mathrm{CrossProduct}\left(\mathrm{v1},\mathrm{v2}\right)\right)$
 $\left[\begin{array}{c}{-285.}\\ {266.}\\ {-665.}\end{array}\right]$ (3)
 > $\mathrm{m1}≔\mathrm{Constant}\left(⟨⟨-92.1,-31.3,67.3⟩⟩\right)$
 ${\mathrm{m1}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Const_2:0}}\\ {\mathrm{Shape: \left[3, 1\right]}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (4)
 > $\mathrm{m2}≔\mathrm{Constant}\left(⟨⟨99.7|29.0|44.5⟩⟩\right)$
 ${\mathrm{m2}}{≔}\left[\begin{array}{c}{\mathrm{DeepLearning Tensor}}\\ {\mathrm{Name: Const_3:0}}\\ {\mathrm{Shape: \left[1, 3\right]}}\\ {\mathrm{Data Type: float\left[8\right]}}\end{array}\right]$ (5)
 > $\mathrm{value}\left(\mathrm{DotProduct}\left(\mathrm{m1},\mathrm{m2}\right)\right)$
 $\left[\begin{array}{ccc}{-9182.37000000000}& {-2670.90000000000}& {-4098.45000000000}\\ {-3120.61000000000}& {-907.700000000000}& {-1392.85000000000}\\ {6709.81000000000}& {1951.70000000000}& {2994.85000000000}\end{array}\right]$ (6)

Compatibility

 • The DeepLearning/Tensor/CrossProduct and DeepLearning/Tensor/DotProduct commands were introduced in Maple 2018.