loss_fn.utils package

Submodules

loss_fn.utils.build_helper module

loss_fn.utils.build_helper.build_cls_teacher_from_opts(opts: Namespace) Module[source]

Helper function to build a classification teacher model from command-line arguments

Parameters:

opts – command-line arguments

Returns:

A teacher model

loss_fn.utils.class_weighting module

loss_fn.utils.class_weighting.compute_class_weights(target: Tensor, n_classes: int, norm_val: float = 1.1) Tensor[source]

Implementation of a class-weighting scheme, as defined in Section 5.2 of ENet paper.

Parameters:
Returns:

A \(C\)-dimensional tensor containing class weights

Module contents