Getting Started

In order to use Plug-AI after you installed it, you should simply call:

python -m plug_ai -kwargs

There are quite a lot of arguments possible so instead of giving them from the command line, you can provide them through a yaml config file by using the argument –config_file

python -m plug_ai -config_file path/to/config_file.yaml

Below is an example of config file that uses:

  • MedNIST Dataset

  • presets transformations

  • DynUnet Model

  • preset training loop

##################################################################################################
######################################## Data arguments : ########################################
##################################################################################################
dataset: MedNIST
dataset_kwargs:
    dataset_dir: MedNIST # Absolute path to the dataset root dir
    download_dataset: false
    transformation: MedNIST_transform
preprocess: null
preprocess_kwargs:
train_ratio: 1
val_ratio: 0.2
limit_sample: 20
batch_size: 2
shuffle: true
drop_last: true

##################################################################################################
####################################### Model arguments : ########################################
##################################################################################################
model: DenseNet
model_kwargs:
    spatial_dims: 2
    in_channels: 1
    out_channels: 6
    img_size: 64
##################################################################################################
##################################### Execution arguments : ######################################
##################################################################################################
nb_epoch: 2
device: cuda
random_seed: 2022
report_log: False

loop: Default
optimizer: SGD
optimizer_kwargs:
    lr: 0.0001
    momentum: 0.99
    weight_decay: 3e-5
    nesterov: True
lr_scheduler: None
lr_scheduler_kwargs:
    step_size: 2
    verbose: True

criterion: DiceCELoss
criterion_kwargs:
    to_onehot_y: False
    softmax: True

metric: None
metric_kwargs:

##################################################################################################
####################################### Global arguments : #######################################
##################################################################################################
config_file: null
export_config: null
mode: TRAINING
verbose: FULL
seed: null