Reference for ultralytics/nn/modules/utils.py
Note
This file is available at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/nn/modules/utils.py. If you spot a problem please help fix it by contributing a Pull Request 🛠️. Thank you 🙏!
ultralytics.nn.modules.utils._get_clones
ultralytics.nn.modules.utils.bias_init_with_prob
Initialize conv/fc bias value according to a given probability value.
ultralytics.nn.modules.utils.linear_init
Initialize the weights and biases of a linear module.
Source code in ultralytics/nn/modules/utils.py
ultralytics.nn.modules.utils.inverse_sigmoid
Calculate the inverse sigmoid function for a tensor.
ultralytics.nn.modules.utils.multi_scale_deformable_attn_pytorch
multi_scale_deformable_attn_pytorch(
value: torch.Tensor,
value_spatial_shapes: torch.Tensor,
sampling_locations: torch.Tensor,
attention_weights: torch.Tensor,
) -> torch.Tensor
Multiscale deformable attention.
https://github.com/IDEA-Research/detrex/blob/main/detrex/layers/multi_scale_deform_attn.py
Source code in ultralytics/nn/modules/utils.py
📅 Created 11 months ago
✏️ Updated 26 days ago