TrainΒΆ

warmup(
frame_encoder_manager: FrameEncoderManager,
list_candidates: List[FrameEncoder],
frame: Frame,
device: Literal['cpu', 'cuda:0'],
) FrameEncoder[source]ΒΆ

Perform the warm-up for a frame encoder. It consists in multiple stages with several candidates, filtering out the best N candidates at each stage. For instance, we can start with 8 different FrameEncoder. We train each of them for 400 iterations. Then we keep the best 4 of them for 400 additional iterations, while finally keeping the final best one.

Warning

The parameter frame_encoder_manager tracking the encoding time of the frame (total_training_time_sec) and the number of encoding iterations (iterations_counter) is modified** in place** by this function.

Parameters:
  • frame_encoder_manager (FrameEncoderManager) – Contains (among other things) the rate constraint \(\lambda\) and description of the warm-up preset. It is also used to track the total encoding time and encoding iterations. Modified in place.

  • list_candidates (List[FrameEncoder]) – The different candidates among which the warm-up will find the best starting point.

  • frame (Frame) – The original image to be compressed and its references.

  • device (Literal['cpu', 'cuda:0']) – On which device should the training run.

Returns:

Warmuped frame encoder, with a great initialization.

Return type:

FrameEncoder