The syntharc architecture relies heavily on a unified interface abstraction. All functional synthesizers inherit from BaseSynthesizer.
BaseSynthesizer(config: dict | None = None)
An abstract base class that enforces method chaining and the three-stage lifecycle. Base implementations automatically handle standard logging, config tracking, and boolean state checks (self.is_prepared, self.is_fitted).
-
prepare(data=None, **kwargs) -> self: Handles hardware setups, model downloading, template extraction, and data caching. Must be called beforegenerate()for models inheriting the_lifecycle = "prepare"class attribute. -
fit(data, **kwargs) -> self: Consumes pandas dataframes or python lists to adapt statistical curves, markov probabilities, or ML weights. Must be called beforegenerate()for models inheriting the_lifecycle = "fit"class attribute. -
generate(num_samples: int, **kwargs) -> Any: Executes the generation loop using the prior prepared/fitted state. Parameter arguments vary by synthesizer type (e.g.seed,max_length,instructions). -
process(data, num_samples, **kwargs): Convenience method that wraps all three. Callsprepare(),fit(), and returns the exact output ofgenerate().
Every syntharc module contains an evaluation.py file exposing functions to score the synthetic distributions:
syntharc.tabular.evaluation.evaluate_tabular(real, synth)syntharc.image.evaluation.evaluate_images(real, synth)syntharc.text.evaluation.evaluate_text(real, synth)syntharc.timeseries.evaluation.evaluate_timeseries(real, synth)
These functions generally return a dictionary of numeric scores denoting distance, similarity bounds, or mathematical overlaps.