Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
66ed6937
Unverified
Commit
66ed6937
authored
Apr 26, 2022
by
Lezwon Castelino
Committed by
GitHub
Apr 26, 2022
Browse files
Added revamped docs for DenseNet (#5878)
* added dense net docs * fix models_new.rst
parent
de31e4b8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
20 deletions
+84
-20
docs/source/models/densenet.rst
docs/source/models/densenet.rst
+27
-0
docs/source/models_new.rst
docs/source/models_new.rst
+1
-0
torchvision/models/densenet.py
torchvision/models/densenet.py
+56
-20
No files found.
docs/source/models/densenet.rst
0 → 100644
View file @
66ed6937
DenseNet
========
.. currentmodule:: torchvision.models
The DenseNet model is based on the `Densely Connected Convolutional Networks
<https://arxiv.org/abs/1608.06993>`_ paper.
Model builders
--------------
The following model builders can be used to instantiate a DenseNet model, with or
without pre-trained weights. All the model builders internally rely on the
``torchvision.models.densenet.DenseNet`` base class. Please refer to the `source
code
<https://github.com/pytorch/vision/blob/main/torchvision/models/densenet.py>`_ for
more details about this class.
.. autosummary::
:toctree: generated/
:template: function.rst
densenet121
densenet161
densenet169
densenet201
docs/source/models_new.rst
View file @
66ed6937
...
@@ -37,6 +37,7 @@ weights:
...
@@ -37,6 +37,7 @@ weights:
:maxdepth: 1
:maxdepth: 1
models/convnext
models/convnext
models/densenet
models/efficientnet
models/efficientnet
models/efficientnetv2
models/efficientnetv2
models/regnet
models/regnet
...
...
torchvision/models/densenet.py
View file @
66ed6937
...
@@ -339,14 +339,23 @@ class DenseNet201_Weights(WeightsEnum):
...
@@ -339,14 +339,23 @@ class DenseNet201_Weights(WeightsEnum):
@
handle_legacy_interface
(
weights
=
(
"pretrained"
,
DenseNet121_Weights
.
IMAGENET1K_V1
))
@
handle_legacy_interface
(
weights
=
(
"pretrained"
,
DenseNet121_Weights
.
IMAGENET1K_V1
))
def
densenet121
(
*
,
weights
:
Optional
[
DenseNet121_Weights
]
=
None
,
progress
:
bool
=
True
,
**
kwargs
:
Any
)
->
DenseNet
:
def
densenet121
(
*
,
weights
:
Optional
[
DenseNet121_Weights
]
=
None
,
progress
:
bool
=
True
,
**
kwargs
:
Any
)
->
DenseNet
:
r
"""Densenet-121 model from
r
"""Densenet-121 model from
`
"
Densely Connected Convolutional Networks
"
<https://arxiv.org/
pdf
/1608.06993
.pdf
>`_.
`Densely Connected Convolutional Networks <https://arxiv.org/
abs
/1608.06993>`_.
The required minimum input size of the model is 29x29.
The required minimum input size of the model is 29x29.
Args:
Args:
weights (DenseNet121_Weights, optional): The pretrained weights for the model
weights (:class:`~torchvision.models.DenseNet121_Weights`, optional): The
progress (bool): If True, displays a progress bar of the download to stderr
pretrained weights to use. See
memory_efficient (bool) - If True, uses checkpointing. Much more memory efficient,
:class:`~torchvision.models.DenseNet121_Weights` below for
but slower. Default: *False*. See `"paper" <https://arxiv.org/pdf/1707.06990.pdf>`_.
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.densenet.DenseNet``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/densenet.py>`_
for more details about this class.
.. autoclass:: torchvision.models.DenseNet121_Weights
:members:
"""
"""
weights
=
DenseNet121_Weights
.
verify
(
weights
)
weights
=
DenseNet121_Weights
.
verify
(
weights
)
...
@@ -356,14 +365,23 @@ def densenet121(*, weights: Optional[DenseNet121_Weights] = None, progress: bool
...
@@ -356,14 +365,23 @@ def densenet121(*, weights: Optional[DenseNet121_Weights] = None, progress: bool
@
handle_legacy_interface
(
weights
=
(
"pretrained"
,
DenseNet161_Weights
.
IMAGENET1K_V1
))
@
handle_legacy_interface
(
weights
=
(
"pretrained"
,
DenseNet161_Weights
.
IMAGENET1K_V1
))
def
densenet161
(
*
,
weights
:
Optional
[
DenseNet161_Weights
]
=
None
,
progress
:
bool
=
True
,
**
kwargs
:
Any
)
->
DenseNet
:
def
densenet161
(
*
,
weights
:
Optional
[
DenseNet161_Weights
]
=
None
,
progress
:
bool
=
True
,
**
kwargs
:
Any
)
->
DenseNet
:
r
"""Densenet-161 model from
r
"""Densenet-161 model from
`
"
Densely Connected Convolutional Networks
"
<https://arxiv.org/
pdf
/1608.06993
.pdf
>`_.
`Densely Connected Convolutional Networks <https://arxiv.org/
abs
/1608.06993>`_.
The required minimum input size of the model is 29x29.
The required minimum input size of the model is 29x29.
Args:
Args:
weights (DenseNet161_Weights, optional): The pretrained weights for the model
weights (:class:`~torchvision.models.DenseNet161_Weights`, optional): The
progress (bool): If True, displays a progress bar of the download to stderr
pretrained weights to use. See
memory_efficient (bool) - If True, uses checkpointing. Much more memory efficient,
:class:`~torchvision.models.DenseNet161_Weights` below for
but slower. Default: *False*. See `"paper" <https://arxiv.org/pdf/1707.06990.pdf>`_.
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.densenet.DenseNet``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/densenet.py>`_
for more details about this class.
.. autoclass:: torchvision.models.DenseNet161_Weights
:members:
"""
"""
weights
=
DenseNet161_Weights
.
verify
(
weights
)
weights
=
DenseNet161_Weights
.
verify
(
weights
)
...
@@ -373,14 +391,23 @@ def densenet161(*, weights: Optional[DenseNet161_Weights] = None, progress: bool
...
@@ -373,14 +391,23 @@ def densenet161(*, weights: Optional[DenseNet161_Weights] = None, progress: bool
@
handle_legacy_interface
(
weights
=
(
"pretrained"
,
DenseNet169_Weights
.
IMAGENET1K_V1
))
@
handle_legacy_interface
(
weights
=
(
"pretrained"
,
DenseNet169_Weights
.
IMAGENET1K_V1
))
def
densenet169
(
*
,
weights
:
Optional
[
DenseNet169_Weights
]
=
None
,
progress
:
bool
=
True
,
**
kwargs
:
Any
)
->
DenseNet
:
def
densenet169
(
*
,
weights
:
Optional
[
DenseNet169_Weights
]
=
None
,
progress
:
bool
=
True
,
**
kwargs
:
Any
)
->
DenseNet
:
r
"""Densenet-169 model from
r
"""Densenet-169 model from
`
"
Densely Connected Convolutional Networks
"
<https://arxiv.org/
pdf
/1608.06993
.pdf
>`_.
`Densely Connected Convolutional Networks <https://arxiv.org/
abs
/1608.06993>`_.
The required minimum input size of the model is 29x29.
The required minimum input size of the model is 29x29.
Args:
Args:
weights (DenseNet169_Weights, optional): The pretrained weights for the model
weights (:class:`~torchvision.models.DenseNet169_Weights`, optional): The
progress (bool): If True, displays a progress bar of the download to stderr
pretrained weights to use. See
memory_efficient (bool) - If True, uses checkpointing. Much more memory efficient,
:class:`~torchvision.models.DenseNet169_Weights` below for
but slower. Default: *False*. See `"paper" <https://arxiv.org/pdf/1707.06990.pdf>`_.
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.densenet.DenseNet``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/densenet.py>`_
for more details about this class.
.. autoclass:: torchvision.models.DenseNet169_Weights
:members:
"""
"""
weights
=
DenseNet169_Weights
.
verify
(
weights
)
weights
=
DenseNet169_Weights
.
verify
(
weights
)
...
@@ -390,14 +417,23 @@ def densenet169(*, weights: Optional[DenseNet169_Weights] = None, progress: bool
...
@@ -390,14 +417,23 @@ def densenet169(*, weights: Optional[DenseNet169_Weights] = None, progress: bool
@
handle_legacy_interface
(
weights
=
(
"pretrained"
,
DenseNet201_Weights
.
IMAGENET1K_V1
))
@
handle_legacy_interface
(
weights
=
(
"pretrained"
,
DenseNet201_Weights
.
IMAGENET1K_V1
))
def
densenet201
(
*
,
weights
:
Optional
[
DenseNet201_Weights
]
=
None
,
progress
:
bool
=
True
,
**
kwargs
:
Any
)
->
DenseNet
:
def
densenet201
(
*
,
weights
:
Optional
[
DenseNet201_Weights
]
=
None
,
progress
:
bool
=
True
,
**
kwargs
:
Any
)
->
DenseNet
:
r
"""Densenet-201 model from
r
"""Densenet-201 model from
`
"
Densely Connected Convolutional Networks
"
<https://arxiv.org/
pdf
/1608.06993
.pdf
>`_.
`Densely Connected Convolutional Networks <https://arxiv.org/
abs
/1608.06993>`_.
The required minimum input size of the model is 29x29.
The required minimum input size of the model is 29x29.
Args:
Args:
weights (DenseNet201_Weights, optional): The pretrained weights for the model
weights (:class:`~torchvision.models.DenseNet201_Weights`, optional): The
progress (bool): If True, displays a progress bar of the download to stderr
pretrained weights to use. See
memory_efficient (bool) - If True, uses checkpointing. Much more memory efficient,
:class:`~torchvision.models.DenseNet201_Weights` below for
but slower. Default: *False*. See `"paper" <https://arxiv.org/pdf/1707.06990.pdf>`_.
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.densenet.DenseNet``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/densenet.py>`_
for more details about this class.
.. autoclass:: torchvision.models.DenseNet201_Weights
:members:
"""
"""
weights
=
DenseNet201_Weights
.
verify
(
weights
)
weights
=
DenseNet201_Weights
.
verify
(
weights
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment