-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
49 lines (46 loc) · 1.23 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import torch
import albumentations as A
from albumentations.pytorch import ToTensorV2
#hyperpararmeters
# update to add a Device DataLoader Class
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
LEARNING_RATE = 3e-5
WEIGHT_DECAY = 5e-4
BATCH_SIZE = 20
NUM_EPOCHS = 100
NUM_WORKERS = 6
CHECKPOINT_FILE = "b3.pth.tar"
PIN_MEMORY = True
SAVE_MODEL = True
LOAD_MODEL = True
train_transforms = A.Compose(
[
A.Resize(width=760, height=760),
A.RandomCrop(height=728, width=728),
A.HorizontalFlip(p=0.5),
A.VerticalFlip(p=0.5),
A.RandomRotate90(p=0.5),
A.Blur(p=0.3),
A.CLAHE(p=0.3),
A.ColorJitter(p=0.3),
A.CoarseDropout(max_holes=12, max_height=20, max_width=20, p=0.3),
A.IAAAffine(shear=30, rotate=0, p=0.2, mode="constant"),
A.Normalize(
mean=[0.3199, 0.2240, 0.1609],
std=[0.3020, 0.2183, 0.1741],
max_pixel_value=255.0,
),
ToTensorV2(),
]
)
val_transforms = A.Compose(
[
A.Resize(height=728, width=728),
A.Normalize(
mean=[0.3199, 0.2240, 0.1609],
std=[0.3020, 0.2183, 0.1741],
max_pixel_value=255.0,
),
ToTensorV2(),
]
)