torch-uncertainty/torch-uncertainty.github.io
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
<!DOCTYPE html>
<html data-content_root="./" lang="en">
<head>
<meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/><meta content="width=device-width, initial-scale=1" name="viewport"/>
<title>Contributing — TorchUncertainty Docs</title>
<script data-cfasync="false">
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
</script>
<!--
this give us a css class that will be invisible only if js is disabled
-->
<noscript>
<style>
.pst-js-only { display: none !important; }
</style>
</noscript>
<!-- Loaded before other Sphinx assets -->
<link href="_static/styles/theme.css?digest=7f76b32a3354e82990f2" rel="stylesheet"/>
<link href="_static/styles/pydata-sphinx-theme.css?digest=7f76b32a3354e82990f2" rel="stylesheet"/>
<link href="_static/pygments.css?v=8f2a1f02" rel="stylesheet" type="text/css"/>
<link href="_static/copybutton.css?v=76b2166b" rel="stylesheet" type="text/css"/>
<link href="_static/sphinx-codeautolink.css?v=b2176991" rel="stylesheet" type="text/css"/>
<link href="_static/sg_gallery.css?v=d2d258e8" rel="stylesheet" type="text/css"/>
<link href="_static/sg_gallery-binder.css?v=f4aeca0c" rel="stylesheet" type="text/css"/>
<link href="_static/sg_gallery-dataframe.css?v=2082cf3c" rel="stylesheet" type="text/css"/>
<link href="_static/sg_gallery-rendered-html.css?v=1277b6f3" rel="stylesheet" type="text/css"/>
<link href="_static/sphinx-design.min.css?v=95c83b7e" rel="stylesheet" type="text/css"/>
<!-- So that users can add custom icons -->
<script defer="" src="_static/scripts/fontawesome.js?digest=7f76b32a3354e82990f2"></script>
<!-- Pre-loaded scripts that we'll load fully later -->
<link as="script" href="_static/scripts/bootstrap.js?digest=7f76b32a3354e82990f2" rel="preload"/>
<link as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=7f76b32a3354e82990f2" rel="preload"/>
<script src="_static/documentation_options.js?v=f3b36f1a"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/clipboard.min.js?v=a7894cd8"></script>
<script src="_static/copybutton.js?v=f281be69"></script>
<script src="_static/design-tabs.js?v=f930bc37"></script>
<script>DOCUMENTATION_OPTIONS.pagename = 'contributing';</script>
<script>DOCUMENTATION_OPTIONS.search_as_you_type = false;</script>
<link href="_static/favicon.ico" rel="icon"/>
<link href="genindex.html" rel="index" title="Index"/>
<link href="search.html" rel="search" title="Search"/>
<link href="references.html" rel="next" title="References"/>
<link href="generated/torch_uncertainty.callbacks.TUSegCheckpoint.html" rel="prev" title="TUSegCheckpoint"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<meta content="en" name="docsearch:language"/>
<meta content="" name="docsearch:version"/>
<script src="_static/searchtools.js"></script>
<script src="_static/language_data.js"></script>
<script src="searchindex.js"></script>
</head>
<body data-default-mode="">
<div class="skip-link d-print-none" id="pst-skip-link"><a href="#main-content">Skip to main content</a></div>
<div id="pst-scroll-pixel-helper"></div>
<button class="btn rounded-pill" id="pst-back-to-top" type="button">
<i class="fa-solid fa-arrow-up"></i>Back to top</button>
<dialog id="pst-search-dialog">
<form action="search.html" class="bd-search d-flex align-items-center" method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input aria-label="Search the docs ..." autocapitalize="off" autocomplete="off" autocorrect="off" class="form-control" name="q" placeholder="Search the docs ..." spellcheck="false" type="search"/>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form>
</dialog>
<div class="pst-async-banner-revealer d-none">
<aside aria-label="Version warning" class="d-none d-print-none" id="bd-header-version-warning"></aside>
</div>
<header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none" id="pst-header">
<div class="bd-header__inner bd-page-width">
<button aria-label="Site navigation" class="pst-navbar-icon sidebar-toggle primary-toggle">
<span class="fa-solid fa-bars"></span>
</button>
<div class="col-lg-3 navbar-header-items__start">
<div class="navbar-item">
<a class="navbar-brand logo" href="index.html">
<img alt="TorchUncertainty Logo" class="logo__image only-light" src="_static/logo.png"/>
<img alt="TorchUncertainty Logo" class="logo__image only-dark pst-js-only" src="_static/logo_dark.png"/>
</a></div>
</div>
<div class="col-lg-9 navbar-header-items">
<div class="me-auto navbar-header-items__center">
<div class="navbar-item">
<nav>
<ul class="bd-navbar-elements navbar-nav">
<li class="nav-item">
<a class="nav-link nav-internal" href="installation.html">
Installation
</a>
</li>
<li class="nav-item">
<a class="nav-link nav-internal" href="quickstart.html">
Quickstart
</a>
</li>
<li class="nav-item">
<a class="nav-link nav-internal" href="auto_tutorials/index.html">
Tutorials
</a>
</li>
<li class="nav-item">
<a class="nav-link nav-internal" href="cli_guide.html">
CLI Guide
</a>
</li>
<li class="nav-item">
<a class="nav-link nav-internal" href="api.html">
API Reference
</a>
</li>
<li class="nav-item dropdown">
<button aria-controls="pst-nav-more-links" aria-expanded="false" class="btn dropdown-toggle nav-item" data-bs-toggle="dropdown" type="button">
More
</button>
<ul class="dropdown-menu" id="pst-nav-more-links">
<li class="current active">
<a class="nav-link dropdown-item nav-internal" href="#">
Contributing
</a>
</li>
<li class="">
<a class="nav-link dropdown-item nav-internal" href="references.html">
References
</a>
</li>
</ul>
</li>
</ul>
</nav></div>
</div>
<div class="navbar-header-items__end">
<div class="navbar-item navbar-persistent--container">
<button aria-label="Search" class="btn search-button-field search-button__button pst-js-only" data-bs-placement="bottom" data-bs-toggle="tooltip" title="Search">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
</div>
<div class="navbar-item">
<button aria-label="Color mode" class="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only" data-bs-placement="bottom" data-bs-title="Color mode" data-bs-toggle="tooltip">
<i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light" title="Light"></i>
<i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark" title="Dark"></i>
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto" title="System Settings"></i>
</button></div>
<div class="navbar-item"><ul aria-label="Icon Links" class="navbar-icon-links">
<li class="nav-item">
<a class="nav-link pst-navbar-icon" data-bs-placement="bottom" data-bs-toggle="tooltip" href="https://github.com/torch-uncertainty/torch-uncertainty" rel="noopener" target="_blank" title="GitHub"><i aria-hidden="true" class="fa-brands fa-square-github fa-lg"></i>
<span class="sr-only">GitHub</span></a>
</li>
</ul></div>
</div>
</div>
<div class="navbar-persistent--mobile">
<button aria-label="Search" class="btn search-button-field search-button__button pst-js-only" data-bs-placement="bottom" data-bs-toggle="tooltip" title="Search">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
</div>
<button aria-label="On this page" class="pst-navbar-icon sidebar-toggle secondary-toggle">
<span class="fa-solid fa-outdent"></span>
</button>
</div>
</header>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
<dialog id="pst-primary-sidebar-modal"></dialog>
<div class="bd-sidebar-primary bd-sidebar hide-on-wide" id="pst-primary-sidebar">
<div class="sidebar-header-items sidebar-primary__section">
<div class="sidebar-header-items__center">
<div class="navbar-item">
<nav>
<ul class="bd-navbar-elements navbar-nav">
<li class="nav-item">
<a class="nav-link nav-internal" href="installation.html">
Installation
</a>
</li>
<li class="nav-item">
<a class="nav-link nav-internal" href="quickstart.html">
Quickstart
</a>
</li>
<li class="nav-item">
<a class="nav-link nav-internal" href="auto_tutorials/index.html">
Tutorials
</a>
</li>
<li class="nav-item">
<a class="nav-link nav-internal" href="cli_guide.html">
CLI Guide
</a>
</li>
<li class="nav-item">
<a class="nav-link nav-internal" href="api.html">
API Reference
</a>
</li>
<li class="nav-item current active">
<a class="nav-link nav-internal" href="#">
Contributing
</a>
</li>
<li class="nav-item">
<a class="nav-link nav-internal" href="references.html">
References
</a>
</li>
</ul>
</nav></div>
</div>
<div class="sidebar-header-items__end">
<div class="navbar-item">
<button aria-label="Color mode" class="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only" data-bs-placement="bottom" data-bs-title="Color mode" data-bs-toggle="tooltip">
<i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light" title="Light"></i>
<i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark" title="Dark"></i>
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto" title="System Settings"></i>
</button></div>
<div class="navbar-item"><ul aria-label="Icon Links" class="navbar-icon-links">
<li class="nav-item">
<a class="nav-link pst-navbar-icon" data-bs-placement="bottom" data-bs-toggle="tooltip" href="https://github.com/torch-uncertainty/torch-uncertainty" rel="noopener" target="_blank" title="GitHub"><i aria-hidden="true" class="fa-brands fa-square-github fa-lg"></i>
<span class="sr-only">GitHub</span></a>
</li>
</ul></div>
</div>
</div>
<div class="sidebar-primary-items__end sidebar-primary__section">
<div class="sidebar-primary-item">
<div class="flat" data-ea-manual="true" data-ea-publisher="readthedocs" data-ea-type="readthedocs-sidebar" id="ethical-ad-placement">
</div></div>
</div>
</div>
<main class="bd-main" id="main-content" role="main">
<div class="bd-content">
<div class="bd-article-container">
<div class="bd-header-article d-print-none">
<div class="header-article-items header-article__inner">
<div class="header-article-items__start">
<div class="header-article-item">
<nav aria-label="Breadcrumb" class="d-print-none">
<ul class="bd-breadcrumbs">
<li class="breadcrumb-item breadcrumb-home">
<a aria-label="Home" class="nav-link" href="index.html">
<i class="fa-solid fa-home"></i>
</a>
</li>
<li aria-current="page" class="breadcrumb-item active"><span class="ellipsis">Contributing</span></li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<div id="searchbox"></div>
<article class="bd-article">
<section id="contributing">
<h1>Contributing<a class="headerlink" href="#contributing" title="Link to this heading">#</a></h1>
<p>TorchUncertainty is in early development stage. We are looking for
contributors to help us build a comprehensive library for uncertainty
quantification in PyTorch.</p>
<p>We are particularly open to any comment that you would have on this project.
Specifically, we are open to changing these guidelines as the project evolves.</p>
<section id="the-scope-of-torchuncertainty">
<h2>The scope of TorchUncertainty<a class="headerlink" href="#the-scope-of-torchuncertainty" title="Link to this heading">#</a></h2>
<p>TorchUncertainty can host any method - if possible linked to a paper - and
roughly contained in the following fields:</p>
<ul class="simple">
<li><p>Uncertainty quantification in general, including Bayesian deep learning, Monte Carlo dropout, ensemble methods, etc.</p></li>
<li><p>Out-of-distribution detection methods</p></li>
<li><p>Applications (e.g. object detection, segmentation, etc.)</p></li>
</ul>
</section>
<section id="common-guidelines">
<h2>Common guidelines<a class="headerlink" href="#common-guidelines" title="Link to this heading">#</a></h2>
<section id="clean-development-install-of-torchuncertainty">
<h3>Clean development install of TorchUncertainty<a class="headerlink" href="#clean-development-install-of-torchuncertainty" title="Link to this heading">#</a></h3>
<p>If you are interested in contributing to torch_uncertainty, we first advise you
to follow the following steps to reproduce a clean development environment
ensuring continuous integration does not break.</p>
<ol class="arabic simple">
<li><p>Install <code class="docutils literal notranslate"><span class="pre">uv</span></code> following the steps <a class="reference external" href="https://docs.astral.sh/uv/getting-started/installation/">here</a></p></li>
<li><p>Clone the repository</p></li>
<li><p>Install torch-uncertainty with the dev packages
<code class="code highlight cmd bash docutils literal highlight-bash">uv<span class="w"> </span>sync<span class="w"> </span>--extra<span class="w"> </span>gpu</code> for GPU-based systems
<code class="code highlight cmd bash docutils literal highlight-bash">uv<span class="w"> </span>sync<span class="w"> </span>--extra<span class="w"> </span>cpu</code> if no GPUs are available</p></li>
<li><p>Install pre-commit hooks with <code class="code highlight cmd bash docutils literal highlight-bash">uv<span class="w"> </span>run<span class="w"> </span>pre-commit<span class="w"> </span>install</code></p></li>
</ol>
<p>Note: failure to include the extra flag will result in the GPU version of PyTorch without CUDA and might cause issues.</p>
</section>
<section id="build-the-documentation-locally">
<h3>Build the documentation locally<a class="headerlink" href="#build-the-documentation-locally" title="Link to this heading">#</a></h3>
<p>To build the documentation on Linux, navigate to <code class="docutils literal notranslate"><span class="pre">./docs</span></code> and build the documentation with:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">html</span>
</pre></div>
</div>
<p>Optionally, specify <code class="docutils literal notranslate"><span class="pre">html-noplot</span></code> instead of <code class="docutils literal notranslate"><span class="pre">html</span></code> to avoid running the tutorials.</p>
</section>
<section id="guidelines">
<h3>Guidelines<a class="headerlink" href="#guidelines" title="Link to this heading">#</a></h3>
<p><strong>Commits</strong></p>
<p>We use ruff for code formatting, linting, and imports (as a drop-in
replacement for black, isort, and flake8). The pre-commit hooks will ensure
that your code is properly formatted and linted before committing.</p>
<p>Please ensure that the tests are passing on your machine before pushing on a
PR. This will avoid multiplying the number featureless commits. To do this,
run, at the root of the folder:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">uv</span> <span class="n">run</span> <span class="n">pytest</span> <span class="n">tests</span>
</pre></div>
</div>
<p>Try to include an emoji at the start of each commit message following the suggestions
from <a class="reference external" href="https://gist.github.com/parmentf/035de27d6ed1dce0b36a">this page</a>.</p>
<p><strong>Pull requests</strong></p>
<p>To make your changes, create a branch on a personal fork and create a PR when your contribution
is mostly finished or if you need help.</p>
<p>Check that your PR complies with the following conditions:</p>
<ul class="simple">
<li><p>The name of your branch is not <code class="docutils literal notranslate"><span class="pre">main</span></code> nor <code class="docutils literal notranslate"><span class="pre">dev</span></code> (see issue #58)</p></li>
<li><p>Your PR does not reduce the code coverage</p></li>
<li><p>Your code is documented: the function signatures are typed, and the main functions have clear docstrings</p></li>
<li><p>Your code is mostly original, and the parts coming from licensed sources are explicitly stated as such</p></li>
<li><p>If you implement a method, please add a reference to the corresponding paper in the
<a class="reference external" href="https://torch-uncertainty.github.io/references.html">references page</a>.</p></li>
<li><p>Also, remember to add TorchUncertainty to the list of libraries implementing this reference
on <a class="reference external" href="https://paperswithcode.com">PapersWithCode</a>.</p></li>
</ul>
<p>If you need help to implement a method, increase the coverage, or solve ruff-raised errors,
create the PR with the <code class="docutils literal notranslate"><span class="pre">need-help</span></code> flag and explain your problems in the comments. A maintainer
will do their best to help you.</p>
</section>
<section id="datasets-datamodules">
<h3>Datasets & Datamodules<a class="headerlink" href="#datasets-datamodules" title="Link to this heading">#</a></h3>
<p>We intend to include datamodules for the most popular datasets only.</p>
</section>
<section id="post-processing-methods">
<h3>Post-processing methods<a class="headerlink" href="#post-processing-methods" title="Link to this heading">#</a></h3>
<p>For now, we intend to follow scikit-learn style API for post-processing
methods (except that we use a validation dataset instead of a numpy array).
You may get inspiration from the already implemented
<a class="reference external" href="https://github.com/torch-uncertainty/torch-uncertainty/blob/dev/torch_uncertainty/post_processing/calibration/temperature_scaler.py">temperature-scaling</a>.</p>
</section>
</section>
<section id="license">
<h2>License<a class="headerlink" href="#license" title="Link to this heading">#</a></h2>
<p>If you feel that the current license is an obstacle to your contribution, let
us know, and we may reconsider. However, the models’ weights hosted on Hugging
Face are likely to remain Apache 2.0.</p>
</section>
</section>
</article>
<footer class="prev-next-footer d-print-none">
<div class="prev-next-area">
<a class="left-prev" href="generated/torch_uncertainty.callbacks.TUSegCheckpoint.html" title="previous page">
<i class="fa-solid fa-angle-left"></i>
<div class="prev-next-info">
<p class="prev-next-subtitle">previous</p>
<p class="prev-next-title">TUSegCheckpoint</p>
</div>
</a>
<a class="right-next" href="references.html" title="next page">
<div class="prev-next-info">
<p class="prev-next-subtitle">next</p>
<p class="prev-next-title">References</p>
</div>
<i class="fa-solid fa-angle-right"></i>
</a>
</div>
</footer>
</div>
<dialog id="pst-secondary-sidebar-modal"></dialog>
<div class="bd-sidebar-secondary bd-toc" id="pst-secondary-sidebar"><div class="sidebar-secondary-items sidebar-secondary__inner">
<div class="sidebar-secondary-item">
<div class="page-toc tocsection onthispage" id="pst-page-navigation-heading-2">
<i class="fa-solid fa-list"></i> On this page
</div>
<nav aria-labelledby="pst-page-navigation-heading-2" class="page-toc" id="pst-page-toc-nav">
<ul class="pst-show_toc_level nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#the-scope-of-torchuncertainty">The scope of TorchUncertainty</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#common-guidelines">Common guidelines</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#clean-development-install-of-torchuncertainty">Clean development install of TorchUncertainty</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#build-the-documentation-locally">Build the documentation locally</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#guidelines">Guidelines</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#datasets-datamodules">Datasets & Datamodules</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#post-processing-methods">Post-processing methods</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#license">License</a></li>
</ul>
</nav></div>
<div class="sidebar-secondary-item">
<div class="tocsection sourcelink">
<a href="_sources/contributing.rst.txt">
<i class="fa-solid fa-file-lines"></i> Show Source
</a>
</div>
</div>
</div></div>
</div>
<footer class="bd-footer-content">
</footer>
</main>
</div>
</div>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script defer="" src="_static/scripts/bootstrap.js?digest=7f76b32a3354e82990f2"></script>
<script defer="" src="_static/scripts/pydata-sphinx-theme.js?digest=7f76b32a3354e82990f2"></script>
<footer class="bd-footer">
<div class="bd-footer__inner bd-page-width">
<div class="footer-items__center">
<div class="footer-item">
<p class="copyright">
© Copyright 2026, Adrien Lafage and Olivier Laurent.
<br/>
</p>
</div>
</div>
</div>
</footer>
</body>
</html>