harbor run -t LiteCoder/cifar10-custom-cnnharbor download LiteCoder/cifar10-custom-cnnBuild and train a custom Convolutional Neural Network (CNN) from scratch on the CIFAR-10 dataset using PyTorch. The implementation must use only low-level PyTorch operations without torchvision.models or pre-trained models.
Data Processing: Download CIFAR-10 and create custom Dataset/DataLoader with normalization (zero-mean, unit-variance)
Model Architecture: Define a CNN using nn.Module with:
Training: Implement training loop that tracks metrics per epoch (train/validation loss and accuracy)
Evaluation: Compute test accuracy and generate confusion matrix on test set
Visualization: Generate plots for training curves and confusion matrix
All outputs must be saved to /app/ directory:
/app/metrics.json - Training and evaluation metrics in JSON format:
{
"train_loss": [epoch1_loss, epoch2_loss, ...],
"train_accuracy": [epoch1_acc, epoch2_acc, ...],
"val_loss": [epoch1_loss, epoch2_loss, ...],
"val_accuracy": [epoch1_acc, epoch2_acc, ...],
"test_accuracy": 0.XX,
"total_parameters": XXXXX,
"confusion_matrix": [[c00, c01, ...], [c10, c11, ...], ...]
}
train_loss, train_accuracy, val_loss, val_accuracy: Arrays of numeric values (one per epoch)test_accuracy: Float between 0 and 1total_parameters: Integer count of model parametersconfusion_matrix: 10x10 array of integers (CIFAR-10 has 10 classes)/app/training_curves.png - Visualization showing:
/app/confusion_matrix.png - Heatmap visualization of the 10x10 confusion matrix with class labels
/app/model_weights.pth - Saved PyTorch model state dictionary
metrics.json must be valid JSON matching the schema above