noether.modeling.functional.init¶
Attributes¶
Functions¶
|
Initialize the bias tensor of a nn.Module instance to zero. |
|
Initialize the weight tensor of a nn.Module instance using the truncated normal initialization with a zero bias |
|
Apply an initialization function to all applicable sub-modules of a given module. |
Module Contents¶
- noether.modeling.functional.init.ALL_CONVS¶
- noether.modeling.functional.init.ALL_LAYERS¶
- noether.modeling.functional.init.init_bias_to_zero(layer_module)¶
Initialize the bias tensor of a nn.Module instance to zero.
- Parameters:
layer_module (torch.nn.Module) – An nn.Module instance, either a Linear or Conv layer.
- Return type:
None
- noether.modeling.functional.init.init_trunc_normal_zero_bias(layer_module, std=0.02)¶
Initialize the weight tensor of a nn.Module instance using the truncated normal initialization with a zero bias vector.
- Parameters:
layer_module (torch.nn.Module) – An nn.Module instance, either a Linear or Conv layer.
std (float) – Standard Deviation value of the normal distribution to sample weights from. Defaults to 0.02.
- Return type:
None
- noether.modeling.functional.init.apply_init_method(module, proj_weight, init_method)¶
Apply an initialization function to all applicable sub-modules of a given module.
- Parameters:
module (torch.nn.Module) – The nn.Module instance to initialize.
init_fn – The initialization function to apply to each sub-module.
proj_weight (torch.Tensor)
init_method (str)
- Return type:
None