dgs.models.engine.dgs_engine.DGSEngine.load_combine_alpha_weights

DGSEngine.load_combine_alpha_weights(fp: str, new_id: int = 0, old_id: int = 0) None[source]

Given the path to a file containing at least the data of one module checkpoint, load the weights of the combine.alpha_weights module.

Notes

During training the DGSEngine was trained with a single alpha model. For testing or (non accuracy) evaluation, multiple alpha values are required. Therefore, the combine.alpha_models now contains more than one AlphaGenerator instance. Thus, the indices of the state dict have to be modified accordingly.

Additionally, in case of the visual embedding generation modules, there are more parameters saved in the checkpoint file, which should not be loaded by this function.

Parameters:
  • fp – The path to the checkpoint file

  • new_id – The ID at which index of the alpha weight modules to insert the loaded weights.

  • old_id – The old ID. Necessary only if there are multiple combine.alpha_models s in a single checkpoint. E.g. when multiple alpha weight generators have been trained in unison.