-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* cifar wrapper * move load_state_dict to nbdt.models.utils * train loss oops * cleaner dataset kwarg attempt * aesthetic changes * decorator for analyzer * imports and docstring * moar aesthetics * more aesthetic
- Loading branch information
Showing
6 changed files
with
129 additions
and
136 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 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 |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
from .lip import * | ||
from .ade20k import * | ||
from torchvision.datasets import * | ||
from .cifar import * |
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,31 @@ | ||
"""Wrappers around CIFAR datasets""" | ||
|
||
from torchvision import datasets, transforms | ||
|
||
__all__ = names = ('CIFAR10', 'CIFAR100') | ||
|
||
|
||
class CIFAR: | ||
|
||
@staticmethod | ||
def transform_train(): | ||
return transforms.Compose([ | ||
transforms.RandomCrop(32, padding=4), | ||
transforms.RandomHorizontalFlip(), | ||
transforms.ToTensor(), | ||
transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)), | ||
]) | ||
|
||
@staticmethod | ||
def transform_val(): | ||
return transforms.Compose([ | ||
transforms.ToTensor(), | ||
transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)), | ||
]) | ||
|
||
|
||
class CIFAR10(datasets.CIFAR10, CIFAR): | ||
pass | ||
|
||
class CIFAR100(datasets.CIFAR100, CIFAR): | ||
pass |
Oops, something went wrong.