A tiny (103KB, 25,957 params) sleep stage classifier distilled from
SleepFM for real-time edge deployment on
NVIDIA Jetson TK1 and similar constrained devices.
1Conv1dStack:
2 hidden_channels: 32
3 kernel_size: 5
1import numpy as np
2import onnxruntime as ort
3
4session = ort.InferenceSession("Conv1dStack_T2_a0.3.onnx")
5
6# Input: pre-pooled embeddings (batch, seq_len, 128)
7embeddings = np.random.randn(1, 120, 128).astype(np.float32)
8logits = session.run(None, {"input": embeddings})[0]
9predicted_stages = np.argmax(logits, axis=-1)
10
11# Stage mapping: 0=Wake, 1=REM, 2=N1, 3=N2, 4=N3
12print(predicted_stages)
1import torch
2
3model = torch.jit.load("Conv1dStack_T2_a0.3.pt")
4embeddings = torch.randn(1, 120, 128)
5logits = model(embeddings)
6predicted_stages = logits.argmax(dim=-1)
1@misc{circadia-distill-2026,
2 title={Distilled Sleep Stage Classifier for Edge Deployment},
3 year={2026},
4 url={https://github.com/circadia}
5}