perceptron.utils.distances

Provides classes to measure the distance between two images.

MeanSquaredDistance Calculates the mean squared error between two images.
MeanAbsoluteDistance Calculates the mean absolute error between two images.
Linfinity Calculates the L-infinity norm of the difference between two images.
L0 Calculates the L0 norm of the difference between two images.
MSE alias of perceptron.utils.distances.MeanSquaredDistance
MAE alias of perceptron.utils.distances.MeanAbsoluteDistance
Linf alias of perceptron.utils.distances.Linfinity
class perceptron.utils.distances.Distance(reference=None, other=None, bounds=None, value=None)[source]

Base class for distances

This class should be subclassed when implementing new distances. Subclasses must implement _calculate.

class perceptron.utils.distances.MeanSquaredDistance(reference=None, other=None, bounds=None, value=None)[source]

Calculates the mean squared error between two images.

class perceptron.utils.distances.MeanAbsoluteDistance(reference=None, other=None, bounds=None, value=None)[source]

Calculates the mean absolute error between two images.

class perceptron.utils.distances.Linfinity(reference=None, other=None, bounds=None, value=None)[source]

Calculates the L-infinity norm of the difference between two images.

class perceptron.utils.distances.L0(reference=None, other=None, bounds=None, value=None)[source]

Calculates the L0 norm of the difference between two images.

perceptron.utils.distances.MSE

alias of perceptron.utils.distances.MeanSquaredDistance

perceptron.utils.distances.MAE

alias of perceptron.utils.distances.MeanAbsoluteDistance

perceptron.utils.distances.Linf

alias of perceptron.utils.distances.Linfinity