Skip to content

Commit

Permalink
Fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ddavidebb committed Aug 14, 2023
2 parents 327a3f5 + 75f4c66 commit 067d94e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
16 changes: 13 additions & 3 deletions recipes/MOABB/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ For training the model using the `leave_one_subject_out` training approach, just

### Hyperparameter Tuning


Efficient hyperparameter tuning is paramount when introducing novel models or experimenting with diverse datasets. Our benchmark establishes a standardized protocol for hyperparameter tuning, utilizing [Orion](https://orion.readthedocs.io/en/stable/) to ensure fair model comparisons.

#### **Overview**
Expand Down Expand Up @@ -192,6 +191,19 @@ As evident from the example, you need to configure the hyperparameter file, spec
When it comes to training the model utilizing the leave_one_subject_out approach, simply employ the `--train_mode leave-one-subject-out` flag.

By default trainings are performed on gpu. However, in case you do not have any gpu available on your machine, you can train models on cpu by specifying the `--device cpu` flag.

**Note:**
- To monitor the status of the hyperparameter optimization, simply enter the following command: `orion status --all`. Ensure that you have added the necessary variables required by orion to your bash environment. You can achieve this by executing the following code within your terminal:

```bash
export ORION_DB_ADDRESS=results/MotorImagery/BNCI2014001/EEGNet/hopt/EEGNet_BNCI2014001_hopt.pkl
export ORION_DB_TYPE=pickleddb
```

Please note that the value of the `ORION_DB_ADDRESS` variable will vary depending on the experiment. Adjust it accordingly.

- If needed, you can interrupt the code at any point, and it will resume from the last successfully completed experiment.

#### **Output Structure**

Results are organized within the specified output folder (`--output_folder`):
Expand All @@ -213,8 +225,6 @@ For further details on arguments and customization options, consult `./run_hpara

- If you intend to perform multiple repetitions of the same hparam optimization, it is necessary to modify the `--exp_name`.

- Feel free to interrupt and resume the hyperparameter optimization script at any point without encountering any complications. Orion is resumable and will restart from the last experiment completed.

- This script is designed for a Linux-based system. In this context, we provide a bash script instead of a Python script due to its natural ability of orchestrating diverse training loops across various subjects and sessions.


Expand Down
2 changes: 1 addition & 1 deletion recipes/MOABB/extra_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mne
moabb
orion[profet]
sklearn
scikit-learn
torchinfo
2 changes: 1 addition & 1 deletion recipes/MOABB/hparams/orion/hparams_tpe.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
experiment:
algorithms:
algorithm:
tpe:
seed: 1986
n_initial_points: 20
Expand Down
3 changes: 3 additions & 0 deletions recipes/MOABB/run_experiments.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ if [ "$rnd_dir" = True ]; then
output_folder="$output_folder/$rnd_dirname"
fi

# Make sure the output_folder is created
mkdir -p $output_folder

# Print command line arguments and save to file
{
echo "hparams: $hparams"
Expand Down
5 changes: 2 additions & 3 deletions recipes/MOABB/run_hparam_optimization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
# - Davide Borra (2023)
###########################################################


# Initialize variables
exp_name=""
output_folder=""
Expand All @@ -65,8 +64,8 @@ mne_dir=""
orion_db_address=""
orion_db_type="PickledDB"
exp_max_trials=50
store_all=False
compress_exp=False
store_all=True
compress_exp=True

# Function to print argument descriptions and exit
print_argument_descriptions() {
Expand Down

0 comments on commit 067d94e

Please sign in to comment.