Skip to main content

Module generators

Module generators 

Source
Expand description

Test data generators for VSA vectors and test datasets

Provides utilities to generate:

  • Random sparse vectors with controlled sparsity
  • Deterministic vectors for reproducible testing
  • Noise patterns and synthetic data
  • Test helper functions for VSA operations

Functionsยง

deterministic_sparse_vec
Generate a deterministic sparse vector using LCG for reproducibility
generate_binary_blob
Generate synthetic binary blob (executable-like pattern)
generate_gradient_pattern
Generate synthetic gradient pattern (useful for image-like data)
generate_noise_pattern
Generate synthetic noise pattern using LCG
mk_random_sparsevec
Alias for random_sparse_vec for backwards compatibility
random_sparse_vec
Generate a random sparse vector with specified dimensions and sparsity
sparse_dot
Compute sparse ternary dot product: (pp + nn) - (pn + np)