Neural Network Toolbox Previous page   Next Page
negdist

Negative distance weight function

Syntax

Z = negdist(W,P)

df = negdist('deriv')

Description

negdist is a weight function. Weight functions apply weights to an input to get weighted inputs.

negdist(W,P) takes these inputs,

and returns the S x Q matrix of negative vector distances.

negdist('deriv') returns '' because negdist does not have a derivative function.

Examples

Here we 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.inputWeight{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

sim, dotprod, dist


Previous page  msereg netprod Next page

© 1994-2005 The MathWorks, Inc.