Main Content

Manhattan distance weight function

takes an `Z`

= mandist(`W`

,`P`

)`S`

-by-`R`

weight matrix, `W`

,
and an `R`

-by-`Q`

matrix of `Q`

input
(column) vectors, `P`

, and returns the
`S`

-by-`Q`

matrix of vector distances,
`Z`

.

`mandist`

is the Manhattan distance weight function. Weight functions
apply weights to an input to get weighted inputs.

`mandist`

is also a layer distance function, which can be used to find
the distances between neurons in a layer.

The Manhattan distance `D`

between two vectors `X`

and
`Y`

is

D = sum(abs(x-y))