| Neural Network Toolbox | |
| Provide feedback about this page |
Syntax
Z = dotprod(W,P,FP) info = dotprod(code) dim = dotprod('size',S,R,FP) dp = dotprod('dp',W,P,Z,FP) dw = dotprod('dw',W,P,Z,FP)
Description
dotprod is the dot product weight function. Weight functions apply weights to an input to get weighted inputs.
dotprod(W,P,FP) takes these inputs,
W |
S x R weight matrix |
P |
R x Q matrix of Q input (column) vectors |
FP |
Struct of function parameters (optional, ignored) |
and returns the S x Q dot product of W and P.
dotprod(code) returns information about this function. The following codes are defined:
dotprod('size',S,R,FP) takes the layer dimension S, input dimension R, and function parameters, and returns the weight size [S x R].
dotprod('dp',W,P,Z,FP) returns the derivative of Z with respect to P.
dotprod('dw',W,P,Z,FP) returns the derivative of Z with respect to W.
Examples
Here you define a random weight matrix W and input vector P and calculate the corresponding weighted input Z.
Network Use
You can create a standard network that uses dotprod by calling newp or newlin.
To change a network so an input weight uses dotprod, set net.inputWeight{i,j}.weightFcn to 'dotprod'. For a layer weight, set net.layerWeight{i,j}.weightFcn to 'dotprod'.
In either case, call sim to simulate the network with dotprod.
See newp and newlin for simulation examples.
See Also
| Provide feedback about this page |
![]() | dividerand | errsurf | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |