| Neural Network Toolbox | |
| Provide feedback about this page |
Scalar product weight function
Syntax
Z = scalprod(W,P,FP) dim = scalprod('size',S,R,FP) dp = scalprod('dp',W,P,Z,FP) dw = scalprod('dw',W,P,Z,FP) info = scalrod(code)
Description
scalprod is the scalar product weight function. Weight functions apply weights to an input to get weighted inputs.
scalprod(W,P) takes these inputs,
W |
1 x 1 weight matrix |
P |
R x Q matrix of Q input (column) vectors |
and returns the R x Q scalar product of W and P defined by Z = w*P.
scalprod(code) returns information about this function. The following codes are defined:
scalprod('size',S,R,FP) takes the layer dimension S, input dimension R, and function parameters, and returns the weight size [1 x 1].
scalprod('dp',W,P,Z,FP) returns the derivative of Z with respect to P.
scalprod('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
To change a network so an input weight uses scalprod, set net.inputWeight{i,j}.weightFcn to 'scalprod'. For a layer weight, set net.layerWeight{i,j}.weightFcn to 'scalprod'.
In either case, call sim to simulate the network with scalprod.
See newp and newlin for simulation examples.
See Also
dotprod, sim, dist, negdist, normprod
| Provide feedback about this page |
![]() | satlins | seq2con | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |