| Neural Network Toolbox | |
| Provide feedback about this page |
Negative distance weight function
Syntax
Z = negdist(W,P,FP) info = negdist(code) dim = negdist('size',S,R,FP) dp = negdist('dp',W,P,Z,FP) dw = negdist('dw',W,P,Z,FP)
Description
negdist is a weight function. Weight functions apply weights to an input to get weighted inputs.
negdist(W,P) takes these inputs,
W |
S x R weight matrix |
P |
R x Q matrix of Q input (column) vectors |
FP |
Row cell array of function parameters (optional, ignored) |
and returns the S x Q matrix of negative vector distances.
negdist(code) returns information about this function. The following codes are defined:
negdist('size',S,R,FP) takes the layer dimension S, input dimension R, and function parameters, and returns the weight size [S x R].
negdist('dp',W,P,Z,FP) returns the derivative of Z with respect to P.
negdist('size',S,R,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 negdist by calling newc or newsom.
To change a network so an input weight uses negdist, set net.inputWeight{i,j}.weightFcn to 'negdist'. For a layer weight, set net.layerWeight{i,j}.weightFcn to 'negdist'.
In either case, call sim to simulate the network with negdist. See newc or newsom for simulation examples.
Algorithm
negdist returns the negative Euclidean distance:
See Also
| Provide feedback about this page |
![]() | nctool | netinv | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |