Neural Network Toolbox™ Previous page   Next Page 
scalprod
 Provide feedback about this page

Scalar product weight function

Syntax

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:

'deriv'
Name of derivative function
'fullderiv'
Reduced derivative = 2, full derivative = 1, linear derivative = 0
'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 the names of function parameters
'fpdefaults'
Returns the default function parameters

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 

Previous page satlins seq2con Next page

 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS