-
Notifications
You must be signed in to change notification settings - Fork 32
✨ Everything as a second level import #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,25 @@ | ||
import pytest | ||
import torch | ||
|
||
from torch_uncertainty.models.segmentation.deeplab import ( | ||
_DeepLabV3, | ||
deep_lab_v3_resnet50, | ||
deep_lab_v3_resnet101, | ||
) | ||
from torch_uncertainty.models.segmentation.deeplab import _DeepLabV3, deep_lab_v3_resnet | ||
|
||
|
||
class TestDeeplab: | ||
"""Testing the Deeplab class.""" | ||
|
||
@torch.no_grad() | ||
def test_main(self): | ||
model = deep_lab_v3_resnet50(10, "v3", 16, True, False).eval() | ||
model = deep_lab_v3_resnet(10, 50, "v3", 16, True, False).eval() | ||
model(torch.randn(1, 3, 32, 32)) | ||
model = deep_lab_v3_resnet50(10, "v3", 16, False, False).eval() | ||
model = deep_lab_v3_resnet101(10, "v3+", 8, True, False).eval() | ||
model = deep_lab_v3_resnet(10, 50, "v3", 16, False, False).eval() | ||
model = deep_lab_v3_resnet(10, 101, "v3+", 8, True, False).eval() | ||
model(torch.randn(1, 3, 32, 32)) | ||
model = deep_lab_v3_resnet101(10, "v3+", 8, False, False).eval() | ||
model = deep_lab_v3_resnet(10, 101, "v3+", 8, False, False).eval() | ||
|
||
def test_errors(self): | ||
with pytest.raises(ValueError, match="Unknown backbone:"): | ||
_DeepLabV3(10, "other", "v3", 16, True, False) | ||
with pytest.raises(ValueError, match="output_stride: "): | ||
deep_lab_v3_resnet50(10, "v3", 15, True, False) | ||
deep_lab_v3_resnet(10, 50, "v3", 15, True, False) | ||
with pytest.raises(ValueError, match="Unknown style: "): | ||
deep_lab_v3_resnet50(10, "v2", 16, True, False) | ||
deep_lab_v3_resnet(10, 50, "v2", 16, True, False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ | |
HTRU2DataModule, | ||
OnlineShoppersDataModule, | ||
SpamBaseDataModule, | ||
UCIClassificationDataModule, | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
# ruff: noqa: F401 | ||
from .aggregated_dataset import AggregatedDataset | ||
from .classification import ( | ||
CIFAR10C, | ||
CIFAR10H, | ||
CIFAR10N, | ||
CIFAR100C, | ||
CIFAR100N, | ||
CUB, | ||
HTRU2, | ||
MNISTC, | ||
BankMarketing, | ||
DOTA2Games, | ||
ImageNetA, | ||
ImageNetC, | ||
ImageNetO, | ||
ImageNetR, | ||
NotMNIST, | ||
OnlineShoppers, | ||
OpenImageO, | ||
SpamBase, | ||
TinyImageNet, | ||
TinyImageNetC, | ||
) | ||
from .fractals import Fractals | ||
from .frost import FrostImages | ||
from .kitti import KITTIDepth | ||
from .muad import MUAD | ||
from .nyu import NYUv2 | ||
from .regression import UCIRegression | ||
from .segmentation import CamVid, Cityscapes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# ruff: noqa: F401, F403 | ||
from .lenet import * | ||
from .resnet import * | ||
from .vgg import * | ||
from .wideresnet import * | ||
# ruff: noqa: F401 | ||
from .lenet import batchensemble_lenet, bayesian_lenet, lenet, packed_lenet | ||
from .resnet import batched_resnet, lpbnn_resnet, masked_resnet, mimo_resnet, packed_resnet, resnet | ||
from .vgg import packed_vgg, vgg | ||
from .wideresnet import ( | ||
batched_wideresnet28x10, | ||
masked_wideresnet28x10, | ||
mimo_wideresnet28x10, | ||
packed_wideresnet28x10, | ||
wideresnet28x10, | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# ruff: noqa: F401, F403 | ||
# ruff: noqa: F401 | ||
from .packed import packed_vgg | ||
from .std import vgg |
12 changes: 6 additions & 6 deletions
12
torch_uncertainty/models/classification/wideresnet/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# ruff: noqa: F401, F403 | ||
from .batched import * | ||
from .masked import * | ||
from .mimo import * | ||
from .packed import * | ||
from .std import * | ||
# ruff: noqa: F401 | ||
from .batched import batched_wideresnet28x10 | ||
from .masked import masked_wideresnet28x10 | ||
from .mimo import mimo_wideresnet28x10 | ||
from .packed import packed_wideresnet28x10 | ||
from .std import wideresnet28x10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# ruff: noqa: F401 | ||
from .bts import bts_resnet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# ruff: noqa: F401 | ||
from .deeplab import deep_lab_v3_resnet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
# ruff: noqa: F401 | ||
from .checkpoints import get_version | ||
from .cli import TULightningCLI | ||
from .distributions import NormalInverseGamma, get_dist_class, get_dist_estimate | ||
from .evaluation_loop import TUEvaluationLoop | ||
from .hub import load_hf | ||
from .misc import csv_writer, plot_hist | ||
from .misc import csv_writer | ||
from .plotting import plot_hist, show | ||
from .trainer import TUTrainer | ||
from .transforms import interpolation_modes_from_str |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.