Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,21 @@ def get_version():
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.coverage",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx.ext.mathjax",
"autodocsumm",
]

# Warn about all references where the target cannot be found.
nitpicky = True
nitpick_ignore = [
# Undocumented classes
("py:class", "torch.FloatTensor"),
("py:class", "torch.LongTensor"),
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down Expand Up @@ -109,6 +118,12 @@ def get_version():
autoclass_content = "both"
autodoc_typehints = "description"

# sphinx.ext.intersphinx
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"torch": ("https://docs.pytorch.org/docs/stable/", None),
}

# --- Work around to make autoclass signatures not (*args, **kwargs) ----------


Expand Down
5 changes: 2 additions & 3 deletions segmentation_models_pytorch/losses/tversky.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TverskyLoss(DiceLoss):
Args:
mode: Metric mode {'binary', 'multiclass', 'multilabel'}
classes: Optional list of classes that contribute in loss computation;
By default, all channels are included.
By default, all channels are included.
log_loss: If True, loss computed as ``-log(tversky)`` otherwise ``1 - tversky``
from_logits: If True assumes input is raw logits
smooth:
Expand All @@ -28,8 +28,7 @@ class TverskyLoss(DiceLoss):
gamma: Constant that squares the error function. Defaults to ``1.0``

Return:
loss: torch.Tensor

torch.Tensor: loss
"""

def __init__(
Expand Down