1import numpy as np
2import os
5SOURCE_FILE = "gaussian/__init__.py"
8def _load_long_description():
9 current_dir = os.path.dirname(os.path.abspath(__file__))
10 md_path = os.path.join(current_dir, "gaussian.md")
11 with open(md_path, "r", encoding="utf-8") as f:
12 return f.read()
15LONG_DESCRIPTION = _load_long_description()
18def create_gaussian_quantized(
19 *, n_samples: int, stddev: float, seed: int
20) -> np.ndarray:
21 rng = np.random.default_rng(seed)
22 x = np.round(rng.normal(0, stddev, n_samples)).astype(np.int16)
23 return x
26def create_gaussian_float(*, n_samples: int, stddev: float, seed: int) -> np.ndarray:
27 rng = np.random.default_rng(seed)
28 x = rng.normal(0, stddev, n_samples).astype(np.float32)
29 return x
32tags_quantized = [
33 "gaussian",
34 "integer",
35 "discrete",
36 "timeseries",
37 "1d",
38 "synthetic",
39 "i.i.d.",
40]
41tags_float = ["gaussian", "float", "timeseries", "1d", "synthetic", "i.i.d."]
43datasets = [
44 {
45 "name": "gaussian-q1",
46 "version": "1",
47 "create": lambda: create_gaussian_quantized(
48 n_samples=1_000_000, stddev=1, seed=0
49 ),
50 "description": "Rounded Gaussian integers with σ=1.",
51 "tags": tags_quantized,
52 "source_file": SOURCE_FILE,
53 "long_description": LONG_DESCRIPTION,
54 },
55 {
56 "name": "gaussian-q2",
57 "version": "1",
58 "create": lambda: create_gaussian_quantized(
59 n_samples=1_000_000, stddev=2, seed=0
60 ),
61 "description": "Rounded Gaussian integers with σ=2.",
62 "tags": tags_quantized,
63 "source_file": SOURCE_FILE,
64 "long_description": LONG_DESCRIPTION,
65 },
66 {
67 "name": "gaussian-q3",
68 "version": "1",
69 "create": lambda: create_gaussian_quantized(
70 n_samples=1_000_000, stddev=3, seed=0
71 ),
72 "description": "Rounded Gaussian integers with σ=3.",
73 "tags": tags_quantized,
74 "source_file": SOURCE_FILE,
75 "long_description": LONG_DESCRIPTION,
76 },
77 {
78 "name": "gaussian-q5",
79 "version": "1",
80 "create": lambda: create_gaussian_quantized(
81 n_samples=1_000_000, stddev=5, seed=0
82 ),
83 "description": "Rounded Gaussian integers with σ=5.",
84 "tags": tags_quantized,
85 "source_file": SOURCE_FILE,
86 "long_description": LONG_DESCRIPTION,
87 },
88 {
89 "name": "gaussian-q8",
90 "version": "1",
91 "create": lambda: create_gaussian_quantized(
92 n_samples=1_000_000, stddev=8, seed=0
93 ),
94 "description": "Rounded Gaussian integers with σ=8.",
95 "tags": tags_quantized,
96 "source_file": SOURCE_FILE,
97 "long_description": LONG_DESCRIPTION,
98 },
99 {
100 "name": "gaussian-flt1",
101 "version": "1",
102 "create": lambda: create_gaussian_float(n_samples=1_000_000, stddev=8, seed=0),
103 "description": "Floating point Gaussian numbers with σ=1.",
104 "tags": tags_float,
105 "source_file": SOURCE_FILE,
106 "long_description": LONG_DESCRIPTION,
107 },
108]