How zhaohualu/syn works
Project Overview and Primary Purpose
• This repository is a research-oriented codebase aimed at “Boosting Data Analytics with Synthetic Volume Expansion.” It contains multiple experiment pipelines (e.g., Syn-Slm, Syn-Boost, Syn-Test) that work with synthetic data generation and analysis using conditional generative models as well as tabular diffusion techniques.
• The project covers several use cases:
– Sentiment analysis (with models such as DistilBERT and LSTM).
– Regression simulation tasks on tabular data using conditional generative methods.
– Prediction and inference experiments where synthetic data is tuned for optimal predictive performance (using CatBoost, optuna tuning, etc.).
Analyzing the File Structure
• Top-Level Project Organization:
– The files are grouped into three main directories: “conditional”, “sentiment”, and “tab-ddpm”.
• “conditional”: Houses scripts and utilities (e.g., ablation_sigma.py) for running regression experiments on tabular data with different sigma parameters.
• “sentiment”: Contains implementations and notebooks for conducting sentiment analysis, including evaluation using GPT-3.5 (via gpt_result.csv) and fine-tuning approaches.
• “tab-ddpm”: This is the largest section and is subdivided into modules such as “lib”, “scripts”, “syninf”, “synpred”, and “tab_ddpm”. These parts include:
▪ Definition of the tabular diffusion model and common utilities.
▪ Training, evaluation, resampling, and tuning scripts.
▪ Directories for simulation inference (“syninf”) and prediction boosting (“synpred”), which contain notebooks, checkpoints, and optuna studies.
▪ “utils” providing additional functions for visualization and synthetic data processing.
• Supporting files such as environment.yml, poetry/pyproject, and various requirements files establish the dependencies and build configurations.
A. Identify Major Components:
– Environment & Dependency Management: Represent the conda and poetry setup that ensures all libraries (e.g., pytorch, diffusion model dependencies) are installed.
– Data Ingestion & Preprocessing: Show separate data directories under “conditional”, “sentiment”, and “tab-ddpm” that feed raw/tabular data or text data.
– Model Training Components:
• For tabular regression (“conditional”) – Scripts like ablation_sigma.py run experiments with different model parameters.
• For diffusion-based generative modeling (“tab-ddpm/tab_ddpm” and “lib”) – Core diffusion model modules (like gaussian_multinomial_diffsuion.py) supported by training pipelines in “scripts/train.py” and tuning scripts.
• For sentiment analysis (“sentiment”) – Implements both transformer-based and LSTM approaches and handles checkpointing.
– Inference & Evaluation:
• Prediction Boost (in synpred): Displays how synthetic data is used alongside raw data. Include the optuna tuning modules (ratio_optuna_studies) and evaluation notebooks.
• Synthetic Test (in syninf): Represents inference on actual datasets (e.g., adult, california) through notebooks and the evaluation pipeline.
– Results & Metrics Storage: Include “result” directories where outputs (csv, pickle files, loss metrics, etc.) are saved.
– External Interactions: Indicate the use of external services like GPT-3.5 and external pre-trained model checkpoints (for DistilBERT in sentiment).
B. Representing Components and Their Relationships:
– Use distinct blocks for each major component area:
◦ Environment Setup (Conda, Poetry) at the top or side as a foundational layer.
◦ Data Sources/Preprocessing block feeding into the model training areas.
▪ For example, data flows from raw data storage to preprocessing scripts, then to training pipelines, and finally to evaluation.
– Label connections that indicate dependencies (e.g., “pre-trained checkpoints”, “evaluation notebooks”).
◦ Rectangles for data sources and storage directories.
◦ Diamonds for decision points (like tuning with optuna).