-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
28 lines (24 loc) · 921 Bytes
/
Copy pathconfig.py
File metadata and controls
28 lines (24 loc) · 921 Bytes
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
# config.py - Configuration file for model training and inference
import torch
# ----------------------------
# Device Setup
# ----------------------------
# Priority: CUDA > MPS (Apple) > CPU
if torch.cuda.is_available():
device = torch.device("cuda")
elif hasattr(torch.backends, "mps") and torch.backends.mps.is_available():
device = torch.device("mps")
else:
device = torch.device("cpu")
# ----------------------------
# Hyperparameters
# ----------------------------
batch_size = 32 # Number of images per training batch
epochs = 10 # Total training epochs
learning_rate = 0.001 # Learning rate for optimizer
num_classes = 8 # Number of output classes (WBC types)
# ----------------------------
# Image Input Dimensions
# ----------------------------
resize_x = 224 # Resize width for input images
resize_y = 224 # Resize height for input images