-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
39 lines (32 loc) · 904 Bytes
/
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
# Third party imports
import torch
from torchvision import transforms
# Device configuration
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# Data preprocessing details
data_transforms = {
'train': transforms.Compose([
transforms.RandomResizedCrop(224),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
]),
'val': transforms.Compose([
transforms.Resize(224),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
]),
}
# train related values
LR = 0.001
MOMENTUM = 0.2
FREEZE_EPOCHS = 1
UNFREEZE_EPOCHS = 200
TRIPLET_MARGIN = 0.3 # the margin to be used for triplet loss
PARAMS = {'batch_size': 8,
'shuffle': True,
'num_workers': 16}
EMBEDDING_SIZE = 256
# command line arguments
ARGS = {}