Skip to content

Commit 4dcb63f

Browse files
committed
Merge branch 'main' of github.com:SFI-Visual-Intelligence/Collaborative-Coding-Exam into mag-branch
2 parents d7c4388 + 36ac636 commit 4dcb63f

File tree

1 file changed

+65
-18
lines changed

1 file changed

+65
-18
lines changed

README.md

Lines changed: 65 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,21 @@
33
# Collaborative-Coding-Exam
44
Repository for final evaluation in the FYS-8805 Reproducible Research and Collaborative coding course
55

6-
## Citation
7-
Several citations can be found under "cite this repository" under the about section.
8-
You can also include this in your BibTex file
9-
```
10-
@software{Thrun_Collaborative_Coding_Exam_2025,
11-
author = {Thrun, Solveig and Salomonsen, Christian and Størdal, Magnus and Zavadil, Jan and Mylius-Kroken, Johan},
12-
month = feb,
13-
title = {{Collaborative Coding Exam}},
14-
url = {https://github.com/SFI-Visual-Intelligence/Collaborative-Coding-Exam},
15-
version = {1.1.0},
16-
year = {2025}
17-
}
18-
```
6+
## **Table of Contents**
7+
1. [Project Description](#project-description)
8+
2. [Installation](#installation)
9+
3. [Usage](#usage)
10+
4. [Results](#results)
11+
5. [Citing](#citing)
12+
13+
## Project Description
14+
This project involves collaborative work on a digit classification task, where each participant works on distinct but interconnected components within a shared codebase. <br>
15+
The main goal is to develop and train digit classification models collaboratively, with a focus on leveraging shared resources and learning efficient experimentation practices.
16+
### Key Aspects of the Project:
17+
- **Individual and Joint Tasks:** Each participant has separate tasks, such as implementing a digit classification dataset, a neural network model, and an evaluation metric. However, all models and datasets must be compatible, as we can only train and evaluate using partners' models and datasets.
18+
- **Shared Environment:** Alongside working on our individual tasks, we collaborate on joint tasks like the main file, and training and evaluation loops. Additionally, we utilize a shared Weights and Biases environment for experiment management.
19+
- **Documentation and Package Management:** To ensure proper documentation and ease of use, we set up Sphinx documentation and made the repository pip-installable
20+
- **High-Performance Computing:** A key learning objective of this project is to gain experience with running experiments on high-performance computing (HPC) resources. To this end, we trained all models on a cluster
1921

2022
## Installation
2123

@@ -39,9 +41,37 @@ python -c "import CollaborativeCoding"
3941

4042
## Usage
4143

42-
TODO: Fill in
44+
To train a classification model using this code, follow these steps:
45+
46+
### 1) Create a Directory for the reuslts
47+
Before running the training script, ensure the results directory exists:
48+
49+
`mkdir -p "<RESULTS_DIRECTORY>"`
50+
51+
### 2) Run the following command for training, evaluation and testing
52+
53+
`python3 main.py --modelname "<MODEL_NAME>" --dataset "<DATASET_NAME>" --metric "<METRIC_1>" "<METRIC_2>" ... "<METRIC_N>" --resultfolder "<RESULTS_DIRECTORY>" --run_name "<RUN_NAME>" --device "<DEVICE>"`
54+
<br> Replace placeholders with your desired values:
55+
56+
- `<MODEL_NAME>`: You can choose from different models ( `"MagnusModel", "ChristianModel", "SolveigModel", "JanModel", "JohanModel"`).
57+
58+
59+
- `<DATASET_NAME>`: The following datasets are supported (`"svhn", "usps_0-6", "usps_7-9", "mnist_0-3", "mnist_4-9"`)
60+
61+
62+
- `<METRIC_1> ... <METRIC_N>`: Specify one or more evaluation metrics (`"entropy", "f1", "recall", "precision", "accuracy"`)
63+
64+
65+
- `<RESULTS_DIRECTORY>`: Folder where all model outputs, logs, and checkpoints are saved
66+
4367

44-
### Running on a k8s cluster
68+
- `<RUN_NAME>`: Name for WANDB project
69+
70+
71+
- `<DEVICE>`: `"cuda", "cpu", "mps"`
72+
73+
74+
## Running on a k8s cluster
4575

4676
In your job manifest, include:
4777

@@ -62,14 +92,31 @@ to pull the latest build, or check the [packages](https://github.com/SFI-Visual-
6292
> The container is build for a `linux/amd64` architecture to properly build Cuda 12. For other architectures please build the docker image locally.
6393
6494

65-
# Results
66-
## JanModel & MNIST_0-3
95+
## Results
96+
### JanModel & MNIST_0-3
6797
This section reports the results from using the model "JanModel" and the dataset MNIST_0-3 which contains MNIST digits from 0 to 3 (Four classes total).
6898
For this experiment we use all five available metrics, and train for a total of 20 epochs.
6999

70100
We achieve a great fit on the data. Below are the results for the described run:
101+
71102
| Dataset Split | Loss | Entropy | Accuracy | Precision | Recall | F1 |
72103
|---------------|-------|---------|----------|-----------|--------|-------|
73104
| Train | 0.000 | 0.000 | 1.000 | 1.000 | 1.000 | 1.000 |
74105
| Validation | 0.035 | 0.006 | 0.991 | 0.991 | 0.991 | 0.991 |
75-
| Test | 0.024 | 0.004 | 0.994 | 0.994 | 0.994 | 0.994 |
106+
| Test | 0.024 | 0.004 | 0.994 | 0.994 | 0.994 | 0.994 |
107+
108+
109+
### MagnusModel & SVHN
110+
The MagnusModel was trained on the SVHN dataset, utilizing all five metrics.
111+
Employing micro-averaging for the calculation of F1 score, accuracy, recall, and precision, the model was fine-tuned over 20 epochs.
112+
A learning rate of 0.001 and a batch size of 64 were selected to optimize the training process.
113+
114+
The table below presents the detailed results, showcasing the model's performance across these metrics.
115+
116+
117+
| Dataset Split | Loss | Entropy | Accuracy | Precision | Recall | F1 |
118+
|---------------|-------|---------|----------|-----------|--------|-------|
119+
| Train | 1.007 | 0.998 | 0.686 | 0.686 | 0.686 | 0.686 |
120+
| Validation | 1.019 | 0.995 | 0.680 | 0.680 | 0.680 | 0.680 |
121+
| Test | 1.196 | 0.985 | 0.634 | 0.634 | 0.634 | 0.634 |
122+

0 commit comments

Comments
 (0)