dgs.utils.torchtools¶
Tools for handling recurring torch tasks. Mostly taken from the torchreid package
Module Functions
|
Closes / Freezes all layers in this model, e.g., for evaluation. |
|
Close / Freeze the specified layers in the given model for training while keeping all other layers unchanged. |
|
Decorator to decorate a class, which has to be a child of torch.nn.Module and the BaseModule! The decorator will then call BaseModule.configure_torch_model on themselves after initializing the original class. |
|
Given either a torch module or an instance of BaseModule, return a torch module. |
|
Given a module instance, initialize a single instance. |
|
Given a torch module, initialize the model parameters using some default weights. |
|
Load a given checkpoint. |
|
Loads pretrianed weights to model. |
|
Opens all layers in this model for training. |
|
Opens the specified layers in the given model for training while keeping all other layers unchanged or frozen. |
|
Resumes training from a checkpoint. |
|
Save a given checkpoint. |
|
Sets BatchNorm layers to eval mode. |
|
A decorator for torch memory analysis using |
|
A decorator for torch memory analysis using |