/ proof-of-concept / benchcompress
Sign in
proof-of-concept / benchcompress
56 lines · 1.6 KBBlameHistoryRaw
1import numpy as np
4SOURCE_FILE = "gaussian/__init__.py"
7def create_gaussian(*, n_samples: int, stddev: float, seed: int) -> np.ndarray:
8 rng = np.random.default_rng(seed)
9 x = np.round(rng.normal(0, stddev, n_samples)).astype(np.int16)
10 return x
13tags = ["integer", "discrete", "synthetic"]
15datasets = [
16 {
17 "name": "gaussian-1",
18 "version": "1",
19 "create": lambda: create_gaussian(n_samples=1_000_000, stddev=1, seed=0),
20 "description": "Rounded Gaussian integers with σ=1.",
21 "tags": tags,
22 "source_file": SOURCE_FILE,
23 },
24 {
25 "name": "gaussian-2",
26 "version": "1",
27 "create": lambda: create_gaussian(n_samples=1_000_000, stddev=2, seed=0),
28 "description": "Rounded Gaussian integers with σ=2.",
29 "tags": tags,
30 "source_file": SOURCE_FILE,
31 },
32 {
33 "name": "gaussian-3",
34 "version": "1",
35 "create": lambda: create_gaussian(n_samples=1_000_000, stddev=3, seed=0),
36 "description": "Rounded Gaussian integers with σ=3.",
37 "tags": tags,
38 "source_file": SOURCE_FILE,
39 },
40 {
41 "name": "gaussian-5",
42 "version": "1",
43 "create": lambda: create_gaussian(n_samples=1_000_000, stddev=5, seed=0),
44 "description": "Rounded Gaussian integers with σ=5.",
45 "tags": tags,
46 "source_file": SOURCE_FILE,
47 },
48 {
49 "name": "gaussian-8",
50 "version": "1",
51 "create": lambda: create_gaussian(n_samples=1_000_000, stddev=8, seed=0),
52 "description": "Rounded Gaussian integers with σ=8.",
53 "tags": tags,
54 "source_file": SOURCE_FILE,
55 },
↑↓ move↵openescclose