-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from ENSTA-U2IS/rework-baselines
Rework baselines
- Loading branch information
Showing
56 changed files
with
1,182 additions
and
1,714 deletions.
There are no files selected for viewing
This file contains 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 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 was deleted.
Oops, something went wrong.
This file contains 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,35 @@ | ||
# fmt: off | ||
from pathlib import Path | ||
|
||
import torch.nn as nn | ||
|
||
from torch_uncertainty import cls_main, init_args | ||
from torch_uncertainty.baselines import ResNet | ||
from torch_uncertainty.datamodules import CIFAR10DataModule | ||
from torch_uncertainty.optimization_procedures import get_procedure | ||
|
||
# fmt: on | ||
if __name__ == "__main__": | ||
root = Path(__file__).parent.absolute().parents[2] | ||
|
||
args = init_args(ResNet, CIFAR10DataModule) | ||
|
||
net_name = f"{args.version}-resnet{args.arch}-cifar10" | ||
|
||
# datamodule | ||
args.root = str(root / "data") | ||
dm = CIFAR10DataModule(**vars(args)) | ||
|
||
# model | ||
model = ResNet( | ||
num_classes=dm.num_classes, | ||
in_channels=dm.num_channels, | ||
loss=nn.CrossEntropyLoss, | ||
optimization_procedure=get_procedure( | ||
f"resnet{args.arch}", "cifar10", args.version | ||
), | ||
imagenet_structure=False, | ||
**vars(args), | ||
) | ||
|
||
cls_main(model, dm, root, net_name, args) |
This file contains 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,35 @@ | ||
# fmt: off | ||
from pathlib import Path | ||
|
||
import torch.nn as nn | ||
|
||
from torch_uncertainty import cls_main, init_args | ||
from torch_uncertainty.baselines import WideResNet | ||
from torch_uncertainty.datamodules import CIFAR10DataModule | ||
from torch_uncertainty.optimization_procedures import get_procedure | ||
|
||
# fmt: on | ||
if __name__ == "__main__": | ||
root = Path(__file__).parent.absolute().parents[2] | ||
|
||
args = init_args(WideResNet, CIFAR10DataModule) | ||
|
||
net_name = f"{args.version}-wideresnet{args.arch}-cifar10" | ||
|
||
# datamodule | ||
args.root = str(root / "data") | ||
dm = CIFAR10DataModule(**vars(args)) | ||
|
||
# model | ||
model = WideResNet( | ||
num_classes=dm.num_classes, | ||
in_channels=dm.num_channels, | ||
loss=nn.CrossEntropyLoss, | ||
optimization_procedure=get_procedure( | ||
f"resnet{args.arch}", "cifar10", args.version | ||
), | ||
imagenet_structure=False, | ||
**vars(args), | ||
) | ||
|
||
cls_main(model, dm, root, net_name, args) |
This file contains 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,35 @@ | ||
# fmt: off | ||
from pathlib import Path | ||
|
||
import torch.nn as nn | ||
|
||
from torch_uncertainty import cls_main, init_args | ||
from torch_uncertainty.baselines import ResNet | ||
from torch_uncertainty.datamodules import CIFAR100DataModule | ||
from torch_uncertainty.optimization_procedures import get_procedure | ||
|
||
# fmt: on | ||
if __name__ == "__main__": | ||
root = Path(__file__).parent.absolute().parents[2] | ||
|
||
args = init_args(ResNet, CIFAR100DataModule) | ||
|
||
net_name = f"{args.version}-resnet{args.arch}-cifar100" | ||
|
||
# datamodule | ||
args.root = str(root / "data") | ||
dm = CIFAR100DataModule(**vars(args)) | ||
|
||
# model | ||
model = ResNet( | ||
num_classes=dm.num_classes, | ||
in_channels=dm.num_channels, | ||
loss=nn.CrossEntropyLoss, | ||
optimization_procedure=get_procedure( | ||
f"resnet{args.arch}", "cifar100", args.version | ||
), | ||
imagenet_structure=False, | ||
**vars(args), | ||
) | ||
|
||
cls_main(model, dm, root, net_name, args) |
This file contains 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,35 @@ | ||
# fmt: off | ||
from pathlib import Path | ||
|
||
import torch.nn as nn | ||
|
||
from torch_uncertainty import cls_main, init_args | ||
from torch_uncertainty.baselines import WideResNet | ||
from torch_uncertainty.datamodules import CIFAR100DataModule | ||
from torch_uncertainty.optimization_procedures import get_procedure | ||
|
||
# fmt: on | ||
if __name__ == "__main__": | ||
root = Path(__file__).parent.absolute().parents[2] | ||
|
||
args = init_args(WideResNet, CIFAR100DataModule) | ||
|
||
net_name = f"{args.version}-wideresnet{args.arch}-cifar10" | ||
|
||
# datamodule | ||
args.root = str(root / "data") | ||
dm = CIFAR100DataModule(**vars(args)) | ||
|
||
# model | ||
model = WideResNet( | ||
num_classes=dm.num_classes, | ||
in_channels=dm.num_channels, | ||
loss=nn.CrossEntropyLoss, | ||
optimization_procedure=get_procedure( | ||
f"resnet{args.arch}", "cifar100", args.version | ||
), | ||
imagenet_structure=False, | ||
**vars(args), | ||
) | ||
|
||
cls_main(model, dm, root, net_name, args) |
This file contains 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,15 @@ | ||
# Classification Benchmarks | ||
|
||
*Work in progress* | ||
|
||
## Image Classification | ||
|
||
### CIFAR-10 | ||
|
||
* ResNet | ||
* WideResNet | ||
|
||
### CIFAR-100 | ||
|
||
* ResNet | ||
* WideResNet |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.