losses

Loss unctions specialized for images and tracking tasks.

Functions

flatten

Flattends the inputs before calling the loss function.

sigmoid

Adds a signmoid transformation to the prediction before calling the loss function.

weighted_crossentropy

Binary crossentropy with weighted classes.

nd_mean_squared_error

Mean square error with flattened inputs.

nd_mean_squared_logarithmic_error

Mean square log error with flattened inputs.

nd_poisson

Poisson error loss flattened inputs.

nd_squared_hinge

Squared hinge error with flattened inputs.

nd_binary_crossentropy

Binary crossentropy error with flattened inputs.

nd_kullback_leibler_divergence

Kullback-Leibler divergence error with flattened inputs.

nd_mean_absolute_error

Mean absolute error with flattened inputs.

nd_mean_absolute_percentage_error

Mean absolute percentage error with flattened inputs.

Module functions

deeptrack_loss_function

deeptrack.losses.deeptrack_loss_function(T, P)

flatten

deeptrack.losses.flatten(func)

Flattens the inputs before calling the loss function.

Parameters

func (loss function) – The loss function to wrap.

Returns

The new loss function.

Return type

function

nd_binary_crossentropy

deeptrack.losses.nd_binary_crossentropy(T, P)

nd_kl_divergence

deeptrack.losses.nd_kl_divergence(T, P)

nd_mean_absolute_error

deeptrack.losses.nd_mean_absolute_error(T, P)

nd_mean_absolute_percentage_error

deeptrack.losses.nd_mean_absolute_percentage_error(T, P)

nd_mean_squared_error

deeptrack.losses.nd_mean_squared_error(T, P)

nd_mean_squared_logarithmic_error

deeptrack.losses.nd_mean_squared_logarithmic_error(T, P)

nd_poisson

deeptrack.losses.nd_poisson(T, P)

nd_squared_hinge

deeptrack.losses.nd_squared_hinge(T, P)

sigmoid

deeptrack.losses.sigmoid(func)

Adds a signmoid transformation to the prediction before calling the loss function.

Parameters

func (loss function) – The loss function to wrap.

Returns

The new loss function.

Return type

function

weighted_crossentropy

deeptrack.losses.weighted_crossentropy(weight=(1, 1), eps=0.0001)

Binary crossentropy with weighted classes.

Parameters

weight (Tuple[float, float]) – Tuple of two numbers, indicating the weighting of the two classes – 1 and 0.

Returns

Weighted binary crossentropy loss function

Return type

function