peal.global_utils.replace_relu_with_leakysoftplus¶
- peal.global_utils.replace_relu_with_leakysoftplus(model)[source]¶
Replace every
ReLUin the module tree by aLeakySoftplus.- Parameters:
model (
torch.nn.Module) – Model modified in place.- Returns:
The same model, for convenience.
- Return type:
Notes
Functional
torch.relucalls inside aforwardare not touched, onlyReLUsubmodules.