protosleepnet.baselines.test_seq_1ch#

Evaluate single-channel SeqSleepNet-Phan on MASS (in-domain).

Loads the pretrained model from HuggingFace and evaluates on the MASS test split using per-subject voting (L=20). Saves per-subject predictions and aggregated metrics.

Usage:

python -m protosleepnet.baselines.test_seq_1ch –gpu_id 0

Attributes#

Functions#

compute_metrics(all_proba, all_targets[, ignore_index])

Compute metrics from aggregated probabilities and targets.

evaluate_subject(model, inputs, L, device)

Sliding-window voting evaluation for a single subject.

main()

Module Contents#

protosleepnet.baselines.test_seq_1ch.compute_metrics(all_proba, all_targets, ignore_index=-1)#

Compute metrics from aggregated probabilities and targets.

protosleepnet.baselines.test_seq_1ch.evaluate_subject(model, inputs, L, device)#

Sliding-window voting evaluation for a single subject.

protosleepnet.baselines.test_seq_1ch.main()#
protosleepnet.baselines.test_seq_1ch.CHANNELS = ['EEG']#
protosleepnet.baselines.test_seq_1ch.CLASS_NAMES = ['W', 'N1', 'N2', 'N3', 'REM']#
protosleepnet.baselines.test_seq_1ch.MODEL_NAME = 'seqsleepnet-phan'#
protosleepnet.baselines.test_seq_1ch.PIPELINE = 'seqsleepnet'#
protosleepnet.baselines.test_seq_1ch.SEQ_LEN = 20#