sc2bench.loss

class sc2bench.loss.BppLoss(entropy_module_path, reduction='mean')[source]

Bit-per-pixel (or rate) loss.

Parameters:
  • entropy_module_path (str) – entropy module path to extract its output from io_dict

  • reduction (str or None) – reduction type (β€˜sum’, β€˜batchmean’, or β€˜mean’)

forward(student_io_dict, *args, **kwargs)[source]

Computes a rate loss.

Parameters:

student_io_dict (dict) – io_dict of model to be trained