File size: 1,175 Bytes
233caeb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
50
51
"""

Configuration file for CIFAR-10 CNN project

"""
import torch

# Data configuration
DATA_DIR = './data'
BATCH_SIZE = 32
NUM_WORKERS = 0  # Set to 0 for better stability on some systems without GPU

# Model configuration
NUM_CLASSES = 10
INPUT_CHANNELS = 3
IMAGE_SIZE = 32
HIDDEN_SIZE = 256
NUM_LAYERS = 2
RNN_DROPOUT = 0.2

# Training configuration
EPOCHS = 5
LEARNING_RATE = 0.01  # Increased slightly for faster convergence in few epochs
WEIGHT_DECAY = 5e-4
MOMENTUM = 0.9

# Device configuration
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

# Checkpoint configuration
CHECKPOINT_DIR = './checkpoints'
BEST_MODEL_PATH = './checkpoints/best_model.pth'
LAST_MODEL_PATH = './checkpoints/last_model.pth'

# Visualization configuration
PLOTS_DIR = './plots'

# CIFAR-10 class names
CLASS_NAMES = [
    'airplane', 'automobile', 'bird', 'cat', 'deer',
    'dog', 'frog', 'horse', 'ship', 'truck'
]

# Data augmentation settings
USE_AUGMENTATION = True
RANDOM_CROP_PADDING = 4
RANDOM_HORIZONTAL_FLIP = 0.5

# Learning rate scheduler
USE_SCHEDULER = True
SCHEDULER_STEP_SIZE = 20
SCHEDULER_GAMMA = 0.1