dotprod
(To be removed) Dot product weight function
dotprod will be removed in a future release. For more information,
see Transition Legacy Neural Network Code to dlnetwork Workflows.
For advice on updating your code, see Version History.
Syntax
Z = dotprod(W,P,FP)
dim = dotprod('size',S,R,FP)
dw = dotprod('dw',W,P,Z,FP)
info = dotprod('code')
Description
Weight functions apply weights to an input to get weighted inputs.
Z = dotprod(W,P,FP) takes these inputs,
W |
|
P |
|
FP | Struct of function parameters (optional, ignored) |
and returns the S-by-Q dot product of
W and P.
dim = dotprod('size',S,R,FP) takes the layer dimension
S, input dimension R, and function parameters,
and returns the weight size [S-by-R].
dw = dotprod('dw',W,P,Z,FP) returns the derivative of
Z with respect to W.
info = dotprod(' returns
information about this function. The following codes are defined: code')
'deriv' | Name of derivative function |
'pfullderiv' | Input: reduced derivative = 2, full derivative = 1, linear derivative = 0 |
'wfullderiv' | Weight: reduced derivative = 2, full derivative = 1, linear derivative = 0 |
'name' | Full name |
'fpnames' | Returns names of function parameters |
'fpdefaults' | Returns default function parameters |
Examples
Here you define a random weight matrix W and input vector
P and calculate the corresponding weighted input
Z.
W = rand(4,3); P = rand(3,1); Z = dotprod(W,P)
Network Use
You can create a standard network that uses dotprod by calling
feedforwardnet.
To change a network so an input weight uses dotprod, set
net.inputWeights{i,j}.weightFcn to 'dotprod'.
For a layer weight, set net.layerWeights{i,j}.weightFcn to
'dotprod'.
In either case, call sim to simulate the network with
dotprod.
Version History
Introduced before R2006aSee Also
Time Series
Modeler | fitrnet (Statistics and Machine Learning Toolbox) | fitcnet (Statistics and Machine Learning Toolbox) | trainnet | trainingOptions | dlnetwork