| --- |
| license: apache-2.0 |
| dataset_info: |
| features: |
| - name: data |
| list: |
| list: float32 |
| splits: |
| - name: chaos |
| num_bytes: 6831025708 |
| num_examples: 69469 |
| - name: signals |
| num_bytes: 7161305200 |
| num_examples: 39725 |
| - name: series |
| num_bytes: 1337735736 |
| num_examples: 20406 |
| download_size: 15333788784 |
| dataset_size: 15330066644 |
| configs: |
| - config_name: default |
| data_files: |
| - split: chaos |
| path: data/chaos-* |
| - split: signals |
| path: data/signals-* |
| - split: series |
| path: data/series-* |
| --- |
| |
| # Example Code for Using the Dataset |
| ```python |
| import numpy as np |
| from torch.utils.data import Dataset |
| from datasets import load_dataset |
| |
| class PretrainDataset(Dataset): |
| def __init__(self, window_size=4096, nvar=11): |
| self.window_size = window_size |
| self.nvar = nvar |
| |
| # init dataset |
| self.ds = load_dataset("mosaic-laboratory/dynamic_systems_pretrain") |
| |
| def __len__(self): |
| return sum([len(self.ds[k]) for k in self.ds.keys()]) |
| |
| def __getitem__(self, idx): |
| # sample from the correct systen set ['chaos', 'signals', 'series'] based on idx |
| if idx < self.ds['chaos']: |
| ds_k = 'chaos' |
| ds_idx = idx |
| elif idx < self.ds['chaos'] + self.ds['signals']: |
| ds_k = 'signals' |
| ds_idx = idx - self.ds['chaos'] |
| else: |
| ds_k = 'series' |
| ds_idx = idx - self.ds['chaos'] - self.ds['signals'] |
| |
| traj = np.array(self.ds[ds_k][ds_idx]['data']) # nvar, L |
| |
| # append dummy |
| if traj.shape[0] < self.nvar: # if less, duplicate |
| dummy_traj = np.random.choice(np.arange(traj.shape[0]), self.nvar-traj.shape[0], replace=True) |
| traj = np.concatenate((traj, traj[dummy_traj]), axis=0) |
| elif traj.shape[0] > self.nvar: # if more, random sample |
| traj = traj[np.random.choice(np.arange(traj.shape[0]), self.nvar, replace=False)] |
| |
| # shuffle channels |
| var_idx = np.random.permutation(traj.shape[0]) |
| traj = np.take(traj, var_idx, axis=0) |
| |
| # in-sample normalization |
| traj = np.nan_to_num(traj, nan=0.0, posinf=0.0, neginf=0.0) |
| traj_std = traj.std(axis=1, keepdims=True) |
| traj_std[traj_std == 0] = 1.0 |
| traj = (traj - traj.mean(axis=1, keepdims=True)) / (traj_std + 1e-8) |
| |
| # clip |
| if traj.shape[1] > self.window_size: |
| start_idx = np.random.choice(np.arange(traj.shape[1]-self.window_size)) |
| traj = traj[:, start_idx:start_idx+self.window_size] |
| |
| # packing |
| curr_pack = { |
| 'sample': torch.from_numpy(traj).float() # nvar, L |
| } |
| |
| # packing |
| return curr_pack |
| ``` |
|
|
|
|
| ## Reference: |
| 1) Lai, Jeffrey, Anthony Bao, and William Gilpin. "Panda: A pretrained forecast model for chaotic dynamics.", ICLR, preprint arXiv:2505.13755 (2026). |
| 2) Luo, Yunfei, et al. "Toward World Modeling of Physiological Signals with Chaos-Theoretic Balancing and Latent Dynamics." preprint arXiv:2605.15465 (2026). |