- class braindecode.training.PostEpochTrainScoring(scoring, lower_is_better=True, name=None, target_extractor=<function to_numpy>)#
Epoch Scoring class that recomputes predictions after the epoch on the training in validation mode.
Note: For unknown reasons, this affects global random generator and therefore all results may change slightly if you add this scoring callback.
scoring (None, str, or callable (default=None)) – If None, use the
scoremethod of the model. If str, it should be a valid sklearn scorer (e.g. “f1”, “accuracy”). If a callable, it should have the signature (model, X, y), and it should return a scalar. This works analogously to the
scoringparameter in sklearn’s
lower_is_better (bool (default=True)) – Whether lower scores should be considered better or worse.
name (str or None (default=None)) – If not an explicit string, tries to infer the name from the
target_extractor (callable (default=to_numpy)) – This is called on y before it is passed to scoring.
- on_epoch_end(net, dataset_train, dataset_valid, **kwargs)#
Called at the end of each epoch.