Skip to content

Commit

Permalink
[Docs] add docstring for ResNet and ResNeXt (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
fangyixiao18 authored Mar 29, 2022
1 parent 3dce8db commit 6655abf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mmselfsup/models/backbones/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,13 @@ def __init__(self,
assert max(out_indices) < num_stages + 1

def forward(self, x):
"""Forward function."""
"""Forward function.
As the behavior of forward function in MMSelfSup is different from
MMCls, we rewrite the forward function. MMCls does not output the
feature map from the 'stem' layer, which we will use for downstream
evaluation.
"""
if self.deep_stem:
x = self.stem(x)
else:
Expand Down
4 changes: 4 additions & 0 deletions mmselfsup/models/backbones/resnext.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ class ResNeXt(ResNet):
Please refer to the `paper <https://arxiv.org/abs/1611.05431>`__ for
details.
As the behavior of forward function in MMSelfSup is different from
MMCls, we register our own ResNeXt, inheriting from
`mmselfsup.model.backbone.ResNet`.
Args:
depth (int): Network depth, from {50, 101, 152}.
groups (int): Groups of conv2 in Bottleneck. Defaults to 32.
Expand Down

0 comments on commit 6655abf

Please sign in to comment.