diff --git a/docs/source/models/efficientnetv2.rst b/docs/source/models/efficientnetv2.rst new file mode 100644 index 00000000000..023b9f58f9b --- /dev/null +++ b/docs/source/models/efficientnetv2.rst @@ -0,0 +1,26 @@ +EfficientNetV2 +============ + +.. currentmodule:: torchvision.models + +The EfficientNetV2 model is based on the `EfficientNetV2: Smaller Models and Faster Training `__ +paper. + + +Model builders +-------------- + +The following model builders can be used to instanciate an EfficientNetV2 model, with or +without pre-trained weights. All the model builders internally rely on the +``torchvision.models.efficientnet.EfficientNet`` base class. Please refer to the `source +code +`_ for +more details about this class. + +.. autosummary:: + :toctree: generated/ + :template: function.rst + + efficientnet_v2_s + efficientnet_v2_m + efficientnet_v2_l diff --git a/docs/source/models_new.rst b/docs/source/models_new.rst index a961f748436..a46d05a6914 100644 --- a/docs/source/models_new.rst +++ b/docs/source/models_new.rst @@ -37,6 +37,7 @@ weights: :maxdepth: 1 models/efficientnet + models/efficientnetv2 models/regnet models/resnet models/squeezenet diff --git a/torchvision/models/efficientnet.py b/torchvision/models/efficientnet.py index cddff74d367..1e42e235a20 100644 --- a/torchvision/models/efficientnet.py +++ b/torchvision/models/efficientnet.py @@ -925,11 +925,22 @@ def efficientnet_v2_s( ) -> EfficientNet: """ Constructs an EfficientNetV2-S architecture from - `"EfficientNetV2: Smaller Models and Faster Training" `_. + `EfficientNetV2: Smaller Models and Faster Training `_. Args: - weights (EfficientNet_V2_S_Weights, optional): The pretrained weights for the model - progress (bool): If True, displays a progress bar of the download to stderr + weights (:class:`~torchvision.models.EfficientNet_V2_S_Weights`, optional): The + pretrained weights to use. See + :class:`~torchvision.models.EfficientNet_V2_S_Weights` below for + more details, and possible values. By default, no pre-trained + weights are used. + progress (bool, optional): If True, displays a progress bar of the + download to stderr. Default is True. + **kwargs: parameters passed to the ``torchvision.models.efficientnet.EfficientNet`` + base class. Please refer to the `source code + `_ + for more details about this class. + .. autoclass:: torchvision.models.EfficientNet_V2_S_Weights + :members: """ weights = EfficientNet_V2_S_Weights.verify(weights) @@ -951,11 +962,22 @@ def efficientnet_v2_m( ) -> EfficientNet: """ Constructs an EfficientNetV2-M architecture from - `"EfficientNetV2: Smaller Models and Faster Training" `_. + `EfficientNetV2: Smaller Models and Faster Training `_. Args: - weights (EfficientNet_V2_M_Weights, optional): The pretrained weights for the model - progress (bool): If True, displays a progress bar of the download to stderr + weights (:class:`~torchvision.models.EfficientNet_V2_M_Weights`, optional): The + pretrained weights to use. See + :class:`~torchvision.models.EfficientNet_V2_M_Weights` below for + more details, and possible values. By default, no pre-trained + weights are used. + progress (bool, optional): If True, displays a progress bar of the + download to stderr. Default is True. + **kwargs: parameters passed to the ``torchvision.models.efficientnet.EfficientNet`` + base class. Please refer to the `source code + `_ + for more details about this class. + .. autoclass:: torchvision.models.EfficientNet_V2_M_Weights + :members: """ weights = EfficientNet_V2_M_Weights.verify(weights) @@ -977,11 +999,22 @@ def efficientnet_v2_l( ) -> EfficientNet: """ Constructs an EfficientNetV2-L architecture from - `"EfficientNetV2: Smaller Models and Faster Training" `_. + `EfficientNetV2: Smaller Models and Faster Training `_. Args: - weights (EfficientNet_V2_L_Weights, optional): The pretrained weights for the model - progress (bool): If True, displays a progress bar of the download to stderr + weights (:class:`~torchvision.models.EfficientNet_V2_L_Weights`, optional): The + pretrained weights to use. See + :class:`~torchvision.models.EfficientNet_V2_L_Weights` below for + more details, and possible values. By default, no pre-trained + weights are used. + progress (bool, optional): If True, displays a progress bar of the + download to stderr. Default is True. + **kwargs: parameters passed to the ``torchvision.models.efficientnet.EfficientNet`` + base class. Please refer to the `source code + `_ + for more details about this class. + .. autoclass:: torchvision.models.EfficientNet_V2_L_Weights + :members: """ weights = EfficientNet_V2_L_Weights.verify(weights)