Skip to content

Commit

Permalink
restructure and bug correction
Browse files Browse the repository at this point in the history
  • Loading branch information
DaliCHEBBI committed Nov 5, 2024
1 parent e33f0f9 commit 9f02224
Show file tree
Hide file tree
Showing 80 changed files with 137 additions and 1,925 deletions.
10 changes: 0 additions & 10 deletions Prepare_dataset.sh

This file was deleted.

Empty file.
2 changes: 1 addition & 1 deletion configs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defaults:
- task: default.yaml
#- predict: default.yaml

- experiment: MSAFFDebug.yaml # default run is for debugging.
- experiment: SIMDebug.yaml # default run is for debugging.

- hydra: default.yaml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defaults:

logger:
comet:
experiment_name: "MSAFF-Overfit"
experiment_name: "SIM-Overfit"

trainer:
min_epochs: 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defaults:

logger:
comet:
experiment_name: "MSAFF_COSINE"
experiment_name: ""
disabled: false


Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# @package _global_
defaults:
- MSAFF_base_run_FR.yaml
- SIM_base_run_FR.yaml

logger:
comet:
experiment_name: "MSAFF_base_run_FR-2x3GPUs"
experiment_name: "SIM_base_run_FR-2x3GPUs"


# 2 nodes x 3 GPUs - No gradient accumulation.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# @package _global_
defaults:
- MSAFF_base_run_FR.yaml
- SIM_base_run_FR.yaml

logger:
comet:
experiment_name: "MSAFF_base_run_FR-2xGPUs"
experiment_name: "SIM_base_run_FR-2xGPUs"

trainer:
strategy: ddp_find_unused_parameters_false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defaults:

logger:
comet:
experiment_name: "MASFF_base_run_FR-(BatchSize10)"
experiment_name: "SIM_base_run_FR-(BatchSize10)"


datamodule:
Expand Down
23 changes: 0 additions & 23 deletions configs/experiment/predict.yaml

This file was deleted.

1 change: 0 additions & 1 deletion configs/model/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ monitor: "val_loss"
false1: 1
false2: 4
learning_rate: 0.001
mode: "feature" # takes "feature" or "feature+decision"


defaults:
Expand Down
12 changes: 12 additions & 0 deletions configs/model/msaff_mlp_model.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
defaults:
- default.yaml
- override criterion: BinaryEntropyLoss.yaml

lr: 0.003933709606504788

neural_net_class_name: "MSNet"
neural_net_hparams:
Inplanes: 32


mode: "feature+decision"
3 changes: 3 additions & 0 deletions configs/model/msaff_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ lr: 0.003933709606504788
neural_net_class_name: "MSNet"
neural_net_hparams:
Inplanes: 32


mode: "feature"
13 changes: 13 additions & 0 deletions configs/model/unet_mlp_model.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
defaults:
- default.yaml
- override criterion: BinaryEntropyLoss.yaml


lr: 0.003933709606504788 # 200-long LR-test-range betw 10^-4 and 3.0

neural_net_class_name: "UNet"
neural_net_hparams:
in_channels: 1
init_features: 32

mode: "feature+decision"
5 changes: 4 additions & 1 deletion configs/model/unet_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ lr: 0.003933709606504788 # 200-long LR-test-range betw 10^-4 and 3.0

neural_net_class_name: "UNet"
neural_net_hparams:
Inplanes: 1
in_channels: 1
init_features: 32

mode: "feature"
14 changes: 14 additions & 0 deletions configs/model/unetattention_mlp_model.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
defaults:
- default.yaml
- override criterion: BinaryEntropyLoss.yaml


lr: 0.003933709606504788 # 200-long LR-test-range betw 10^-4 and 3.0

neural_net_class_name: "UNetGatedAttention"
neural_net_hparams:
in_channels: 1
init_features: 32


mode: "feature+decision"
6 changes: 5 additions & 1 deletion configs/model/unetattention_model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ lr: 0.003933709606504788 # 200-long LR-test-range betw 10^-4 and 3.0

neural_net_class_name: "UNetGatedAttention"
neural_net_hparams:
Inplanes: 1
in_channels: 1
init_features: 32


mode: "feature"
4 changes: 0 additions & 4 deletions create_hdf5.sh

This file was deleted.

10 changes: 5 additions & 5 deletions docs/source/guides/train_new_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ To test your setup and logging capabilities, you can try overfitting on a single
To overfit on a single batch for 30 epochs, run:

```bash
python run.py experiment=MSAFFDebug
python run.py experiment=SIMDebug
```

## Training

Define your experiment hyperparameters in an experiment file in the `configs/experiment` folder. You may stem from one of the provided experiment file (e.g. `MSAFF_base_run_FR.yaml`).
Define your experiment hyperparameters in an experiment file in the `configs/experiment` folder. You may stem from one of the provided experiment file (e.g. `SIM_base_run_FR.yaml`).

To run a typically nominal training,validation and testing, run:

```bash
python run.py experiment=MSAFF_base_run_FR
python run.py experiment=SIM_base_run_FR
```

After training, you model best checkpoints and hydra config will be saved in a `DATE/TIME/` subfolder of the `LOGS_DIR` you specified, with an associated hydra `config.yaml`.
Expand All @@ -39,7 +39,7 @@ You can perfom this automatically before training by setting `task.auto_lr_find=

### Multi-GPUs

Multi-GPUs training is supported. Refer to e.g. experiment file `MSAFF_base_run_FR-MultiGPU.yaml` for pytorch lightning flags to activate it.
Multi-GPUs training is supported. Refer to e.g. experiment file `SIM_base_run_FR-MultiGPU.yaml` for pytorch lightning flags to activate it.
Multi-GPUs training effectively reduces training time by the number of GPUs used. Batch size might need to be reduced to keep a constant number of steps per epoch in DDP.

## Testing the model
Expand All @@ -66,4 +66,4 @@ python run.py experiment=test

## Inference

To use the checkpointed model to make predictions on new data, refer to section [Performing inference on new data](../tutorials/make_predictions.md).
To use the checkpointed model to make predictions on new data, refer to section [Performing inference on new data](../tutorials/make_predictions.md).
2 changes: 0 additions & 2 deletions extract_model_tronto.sh

This file was deleted.

33 changes: 0 additions & 33 deletions outputs/2024-09-18/18-15-24/.hydra/config.yaml

This file was deleted.

Loading

0 comments on commit 9f02224

Please sign in to comment.