Skip to content

Commit 486c223

Browse files
Docs: Eval readme added
1 parent c90edb7 commit 486c223

3 files changed

Lines changed: 77 additions & 5 deletions

File tree

financial_loss_functions/scripts/run_evaluation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,15 @@ def cleanup_on_interrupt():
8383
'-pm',
8484
'--prev_mode',
8585
choices=['one_model', 'one'],
86-
help='Choose, models to evaluate. This can be for selected models or a single model'
86+
default='one_model',
87+
help='Choose the previous grid mode used for tuning. This is used to collect artifacts'
8788
)
8889

8990
parser.add_argument(
9091
'-m',
9192
'--model_losses',
9293
nargs='+',
93-
help="Model Loss combination name must be in the format <ModelName>-<LossName>"
94+
help='Model Loss combination name must be in the format <ModelName>-<LossName>'
9495
)
9596

9697
parser.add_argument('-mpi', '--mpi', action='store_true', help='MPI for HPC')
Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,72 @@
1-
# Evaluation on Test Data
1+
# Evaluation on Test Data
2+
[<- Back to Main README](/financial_loss_functions/README.md)
3+
4+
## Evaluate Selected Candidates on the Test Data
5+
6+
### Run Evaluation on Test Data
7+
```bash
8+
python -m scripts.run_evaluation [--prev_mode PREVIOUS MODE] [OPTIONS]
9+
```
10+
11+
#### Arguments Reference
12+
| Flag | Long Flag | Choices / Type | Default | Notes |
13+
| :--- | :--- | :--- | :--- | :--- |
14+
| `-pm` | `--prev_mode` | `one_model`, `one` | `one_model` | The grid mode used in the previous tuning stage. |
15+
| `-m` | `--model_losses` | `[<MODEL_NAME1>-<LOSS_NAME1>]` | None | List of model-loss combinations to run the test evaluation |
16+
| `-mpi` | `--mpi` | *None* | None | Flag to use mpi for distributed evaluation if grid mode is "one_model" |
17+
18+
#### Examples:
19+
1. Run a selected collection of model-loss combinations on a HPC cluster.
20+
```bash
21+
srun python -m scripts.run_evaluation --model_losses <MODEL_NAME1>-<LOSS_NAME1> <MODEL_NAME2>-<LOSS_NAME2> --mpi
22+
```
23+
24+
To run this sequentially (not recommended):
25+
```bash
26+
python -m scripts.run_evaluation --model_losses <MODEL_NAME1>-<LOSS_NAME1> <MODEL_NAME2>-<LOSS_NAME2>
27+
```
28+
29+
2. Run specific model-loss combination (no mpi, flag will be ignored):
30+
```bash
31+
python -m scripts.run_evaluation --model_losses <MODEL_NAME1>-<LOSS_NAME1>
32+
```
33+
34+
3. Run specific model-loss combination when the previously used mode was 'one':
35+
```bash
36+
python -m scripts.run_evaluation --prev_mode one --model_losses <MODEL_NAME1>-<LOSS_NAME1>
37+
``
38+
39+
4. To get help
40+
```bash
41+
python -m scripts.run_evaluation --help
42+
```
43+
44+
#### Example SBATCH Script
45+
```bash
46+
#!/bin/bash -l
47+
48+
#SBATCH --job-name=<JOB NAME>
49+
#SBATCH --comment="<DESCRIPTION>"
50+
51+
#SBATCH --account=<ACC. NAME>
52+
#SBATCH --partition=<PARTITION NAME> # Partition to run your job on
53+
54+
#SBATCH --output=<OUTPUT FILE PATH> # Output file
55+
#SBATCH --error=<ERROR FILE PATH> # Error file
56+
57+
#SBATCH --time=0-28:00:00 # Time limit - d:hh:mm:ss
58+
#SBATCH --nodes=1 # How many nodes to run on
59+
#SBATCH --ntasks-per-node=8 # Ranks per node
60+
#SBATCH --cpus-per-task=2 # Number of CPUs per task
61+
#SBATCH --mem-per-cpu=4g # Memory per CPU
62+
#SBATCH --gres=gpu:2 # GPUs per node
63+
64+
65+
# Running Code
66+
source /home/<USER_NAME>/miniconda3/etc/profile.d/conda.sh
67+
conda activate <ENV_NAME>
68+
69+
srun python -m scripts.run_evaluation -pm one_model \
70+
-m <MODEL_NAME1>-<LOSS_NAME1> <MODEL_NAME2>-<LOSS_NAME2> -mpi
71+
```
72+
All SBATCH examples can be found at `./scripts/sample_batch_scripts/`. The example above can be found at [sample_batch_script](../../scripts/sample_batch_scripts/sample_test_all.sh).

financial_loss_functions/src/training/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ To run this sequentially (not recommended):
3535
python -m scripts.run_training --model '<Model Name>' --tune
3636
```
3737

38-
2. Run specific model-loss combination with tuning (no mpi):
38+
2. Run specific model-loss combination with tuning (no mpi, flag will be ignored):
3939
```bash
4040
python -m scripts.run_training --grid_mode one --model '<Model Name>' --loss_name '<Loss Name>' --tune
4141
```
@@ -72,7 +72,7 @@ conda activate <ENV_NAME>
7272

7373
srun python -m scripts.run_training -gm one_model -m <MODEL_NAME> -t -mpi
7474
```
75-
All SBATCH examples can be found at `./scripts/sample_batch_scripts/`. The example above can be found at [sample_batch_scripts](../../scripts/sample_batch_scripts/sample_one_model_tune.sh).
75+
All SBATCH examples can be found at `./scripts/sample_batch_scripts/`. The example above can be found at [sample_batch_script](../../scripts/sample_batch_scripts/sample_one_model_tune.sh).
7676

7777
## Available Models and Loss Functions
7878
### Neural Network Models

0 commit comments

Comments
 (0)