Documentation
¶
Overview ¶
Package noise provides functionality for Vald.
package noise provides a noise generator for adding noise to vectors.
package noise provides a noise generator for adding noise to vectors.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Modifier ¶
type Modifier interface {
// Mod returns a function which, given a sample index and a vector,
// produces a modified vector with noise added.
Mod() Func
}
Modifier defines the interface for adding noise on‑the‑fly. External packages obtain the noise‑adding function via the Mod method.
func New ¶
New constructs a new noiseGenerator instance using the Functional Option Pattern. It applies the default options first, then any user‑provided options. It precomputes the noise level and noise table size based on the input dataset and test sample count, and then precomputes the noise table. It returns a Modifier interface.
type Option ¶
type Option func(*noiseGenerator)
Option is a functional option for configuring a noiseGenerator.
func WithLevelFactor ¶
WithLevelFactor sets the fraction of the average standard deviation used as the noise level.
func WithMinTableSize ¶
WithMinTableSize sets the minimum allowed size for the noise table.
func WithTableDivisionFactor ¶
WithTableDivisionFactor sets the division factor used when sizing the noise table.