def METHOD_NAME(metric, save_checkpoints=True):
    # https://pytorch-lightning.readthedocs.io/en/latest/generated/pytorch_lightning.callbacks.ModelCheckpoint.html
    # By default, dirpath is None and will be set at runtime to the location specified
    # by Trainer’s default_root_dir or weights_save_path arguments,
    # and if the Trainer uses a logger, the path will also contain logger name and version.
    if save_checkpoints:
        # by default, save the checkpoint for the last epoch and the epoch with the best validation error
        checkpoint_callback = pl.callbacks.ModelCheckpoint(monitor=metric, save_last=True, period=1, save_top_k=1)
    else:
        checkpoint_callback = None
    # does not work at the moment on laptop with gpu
    gpus = 1 if torch.cuda.is_available() else 0
    #gpus = 0
    params = {
        'log_every_n_steps': 1,
        'flush_logs_every_n_steps': 10,
        'progress_bar_refresh_rate': 1,
        'checkpoint_callback': checkpoint_callback,
        'gpus': gpus,
    }
    return params