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

Dot product weight function

Syntax

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:

'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

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

sim, dist, negdist, normprod


 Provide feedback about this page 

Previous page dividerand errsurf Next page

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