Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/docstrings' into docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Feb 25, 2024
2 parents bfda908 + eca640f commit a9a2716
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions models/experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ def __init__(self, c1, c2, k=(1, 3), s=1, equal_ch=True): # ch_in, ch_out, kern
self.act = nn.SiLU()

def forward(self, x):
"""Performs forward pass by applying SiLU activation on batch-normalized concatenated convolutional layer outputs."""
"""Performs forward pass by applying SiLU activation on batch-normalized concatenated convolutional layer
outputs.
"""
return self.act(self.bn(torch.cat([m(x) for m in self.m], 1)))


class Ensemble(nn.ModuleList):
"""Ensemble of models."""

def __init__(self):
"""Initializes an ensemble of models to be used for aggregated predictions."""
super().__init__()
Expand All @@ -74,7 +77,8 @@ def forward(self, x, augment=False, profile=False, visualize=False):


def attempt_load(weights, device=None, inplace=True, fuse=True):
"""Loads and fuses an ensemble or single YOLOv5 model from weights, handling device placement and model adjustments.
"""
Loads and fuses an ensemble or single YOLOv5 model from weights, handling device placement and model adjustments.
Example inputs: weights=[a,b,c] or a single model weights=[a] or weights=a.
"""
Expand Down

0 comments on commit a9a2716

Please sign in to comment.