npy_weighted_dist¶
-
odl.space.npy_tensors.
npy_weighted_dist
(weights, exponent=2.0)[source]¶ Weighted distance on
TensorSpace
’s as free function.- Parameters
- weightsscalar or
array-like
Weights of the distance. A scalar is interpreted as a constant weight, a 1-dim. array as a weighting vector.
- exponentpositive
float
Exponent of the norm.
- weightsscalar or
- Returns
- dist
callable
Distance function with given weight. Constant weightings are applicable to spaces of any size, for arrays the sizes of the weighting and the space must match.
- dist