Skip to main content

SyntheticConfig

Struct SyntheticConfig 

Source
pub struct SyntheticConfig {
    pub augmentation_ratio: f32,
    pub quality_threshold: f32,
    pub diversity_weight: f32,
    pub max_attempts: usize,
    pub seed: u64,
    pub andon: AndonConfig,
}
Expand description

Configuration for synthetic data generation.

Controls the ratio of synthetic to original data, quality thresholds, and diversity weighting for sample selection.

§Example

use aprender::synthetic::SyntheticConfig;

let config = SyntheticConfig::default()
    .with_augmentation_ratio(1.0)  // 1x synthetic data
    .with_quality_threshold(0.8)   // 80% minimum quality
    .with_diversity_weight(0.3);   // 30% weight on diversity

assert_eq!(config.augmentation_ratio, 1.0);
assert_eq!(config.quality_threshold, 0.8);

Fields§

§augmentation_ratio: f32

Ratio of synthetic to original data (0.0 = none, 2.0 = 2x original).

§quality_threshold: f32

Minimum quality threshold for accepting generated samples [0.0, 1.0].

§diversity_weight: f32

Weight given to diversity vs quality in sample selection [0.0, 1.0].

§max_attempts: usize

Maximum generation attempts per sample before giving up.

§seed: u64

Random seed for reproducibility.

§andon: AndonConfig

Andon configuration for quality monitoring (Toyota Jidoka).

Implementations§

Source§

impl SyntheticConfig

Source

pub fn new() -> Self

Create a new configuration with default values.

Source

pub fn with_augmentation_ratio(self, ratio: f32) -> Self

Set the augmentation ratio.

§Arguments
  • ratio - Ratio of synthetic to original data (clamped to [0.0, 10.0])
Source

pub fn with_quality_threshold(self, threshold: f32) -> Self

Set the quality threshold.

§Arguments
  • threshold - Minimum quality score for acceptance (clamped to [0.0, 1.0])
Source

pub fn with_diversity_weight(self, weight: f32) -> Self

Set the diversity weight.

§Arguments
  • weight - Weight for diversity vs quality (clamped to [0.0, 1.0])
Source

pub fn with_max_attempts(self, attempts: usize) -> Self

Set the maximum generation attempts.

§Arguments
  • attempts - Maximum attempts per sample (minimum 1)
Source

pub fn with_seed(self, seed: u64) -> Self

Set the random seed for reproducibility.

Source

pub fn with_andon(self, andon: AndonConfig) -> Self

Set the Andon configuration for quality monitoring.

Source

pub fn with_andon_enabled(self, enabled: bool) -> Self

Enable or disable Andon monitoring.

Source

pub fn with_andon_rejection_threshold(self, threshold: f32) -> Self

Set the Andon rejection threshold.

Source

pub fn target_count(&self, seed_count: usize) -> usize

Calculate target synthetic sample count from seed count.

§Arguments
  • seed_count - Number of original seed samples
§Returns

Target number of synthetic samples to generate.

Source

pub fn meets_quality(&self, score: f32) -> bool

Check if a quality score meets the threshold.

Source

pub fn combined_score(&self, quality: f32, diversity: f32) -> f32

Calculate combined score from quality and diversity.

§Arguments
  • quality - Quality score [0.0, 1.0]
  • diversity - Diversity score [0.0, 1.0]
§Returns

Weighted combination: (1 - diversity_weight) * quality + diversity_weight * diversity

Trait Implementations§

Source§

impl Clone for SyntheticConfig

Source§

fn clone(&self) -> SyntheticConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SyntheticConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SyntheticConfig

Source§

fn default() -> Self

Creates a default configuration with conservative settings.

  • augmentation_ratio: 0.5 (50% synthetic data)
  • quality_threshold: 0.7 (70% minimum quality)
  • diversity_weight: 0.3 (30% diversity weight)
  • max_attempts: 10 attempts per sample
  • seed: 42 for reproducibility
  • andon: Enabled with 90% rejection threshold (Toyota Jidoka)
Source§

impl PartialEq for SyntheticConfig

Source§

fn eq(&self, other: &SyntheticConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SyntheticConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V