mirror of
https://github.com/aladdinpersson/Machine-Learning-Collection.git
synced 2026-04-10 12:33:44 +00:00
add imbalanced classes video code and kaggle cat vs dog
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import torch
|
||||
import albumentations as A
|
||||
from albumentations.pytorch import ToTensorV2
|
||||
|
||||
SEED = 42
|
||||
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
||||
NUM_WORKERS = 4
|
||||
BATCH_SIZE = 64
|
||||
PIN_MEMORY = True
|
||||
LOAD_MODEL = True
|
||||
LEARNING_RATE = 1e-4
|
||||
NUM_EPOCHS = 100
|
||||
|
||||
train_transforms = A.Compose([
|
||||
A.Resize(width=224, height=224,),
|
||||
A.RandomCrop(width=224, height=224),
|
||||
A.Rotate(40),
|
||||
A.HorizontalFlip(p=0.5),
|
||||
A.VerticalFlip(p=0.1),
|
||||
A.Normalize(
|
||||
mean=[0, 0, 0],
|
||||
std=[1, 1, 1],
|
||||
max_pixel_value=255.0,
|
||||
),
|
||||
ToTensorV2(),
|
||||
])
|
||||
|
||||
val_transforms = A.Compose([
|
||||
A.Resize(height=224, width=224),
|
||||
A.Normalize(
|
||||
mean=[0, 0, 0],
|
||||
std=[1, 1, 1],
|
||||
max_pixel_value=255.0,
|
||||
),
|
||||
ToTensorV2(),
|
||||
])
|
||||
Reference in New Issue
Block a user