igl.data
Synthetic data generators for tests and examples.
igl.data.synthetic.make_flat_torus(n_samples, *, noise=0.0, seed=None)
Flat torus T² embedded in R⁴ via (cos θ₁, sin θ₁, cos θ₂, sin θ₂).
Intrinsic dimension: 2 (the two angles).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_samples
|
int
|
Number of points to sample. |
required |
noise
|
float
|
Additive Gaussian noise std in the ambient |
0.0
|
seed
|
int | None
|
Optional RNG seed (does not affect the global RNG state). |
None
|
Returns:
| Type | Description |
|---|---|
Tensor
|
|
Tensor
|
and |
igl.data.synthetic.make_flat_torus_labels(theta, *, task='regression_smooth')
Build labels for a flat-torus task from the intrinsic angles.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
theta
|
Tensor
|
|
required |
task
|
str
|
One of:
|
'regression_smooth'
|
Returns:
| Type | Description |
|---|---|
Tensor
|
Tensor of labels (float for regression, long for classification). |
Raises:
| Type | Description |
|---|---|
IGLConfigError
|
For an unknown |
igl.data.synthetic.make_swiss_roll(n_samples, *, noise=0.0, seed=None)
Swiss roll in R³: x(t, h) = (t cos t, h, t sin t).
Intrinsic dimension: 2 (t and h).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_samples
|
int
|
Number of points to sample. |
required |
noise
|
float
|
Additive Gaussian noise std in ambient space. |
0.0
|
seed
|
int | None
|
Optional RNG seed. |
None
|
Returns:
| Type | Description |
|---|---|
Tensor
|
|
Tensor
|
|
igl.data.synthetic.make_moons(n_samples, *, noise=0.1, seed=None)
Two interleaving half-moons in R².
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_samples
|
int
|
Total number of points (split evenly between moons). |
required |
noise
|
float
|
Additive Gaussian noise std. |
0.1
|
seed
|
int | None
|
Optional RNG seed. |
None
|
Returns:
| Type | Description |
|---|---|
Tensor
|
|
Tensor
|
binary class labels ( |
igl.data.synthetic.embed_in_high_dim(x, *, target_dim, seed=None)
Embed low-D points in target_dim via padding + random orthogonal rotation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Low-D data |
required |
target_dim
|
int
|
Ambient dimension |
required |
seed
|
int | None
|
Optional RNG seed. |
None
|
Returns:
| Type | Description |
|---|---|
Tensor
|
|
Raises:
| Type | Description |
|---|---|
IGLConfigError
|
If |
igl.data.synthetic.make_spd_dataset(n_samples, *, d=4, n_classes=2, class_separation=1.0, seed=None)
Generate batches of SPD matrices labelled by class.
Each class is a mixture of two ingredients:
- A class-specific mean SPD
C_k = exp(S_k)whereS_kis a symmetric matrix sampled once per class (controlled byclass_separation). - Per-sample noise added in log-Euclidean tangent space, then mapped
back to the manifold via :func:
igl.spd.matrix_exp_sym.
Useful as a labelled toy dataset for :class:igl.spd.IGLReconSPDClassifier
smoke tests and synthetic experiments — no MOABB / mne dependency.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_samples
|
int
|
Total number of SPD matrices. |
required |
d
|
int
|
Side length of each SPD matrix. |
4
|
n_classes
|
int
|
Number of distinct class means. |
2
|
class_separation
|
float
|
Std of the per-class log-Euclidean mean. |
1.0
|
seed
|
int | None
|
Optional RNG seed. |
None
|
Returns:
| Type | Description |
|---|---|
Tensor
|
|
Tensor
|
is a |