How anyesh/art_gan works
Project Type & Purpose
• This is a standalone Python machine‐learning project (not a web app), focused on training a Generative Adversarial Network (GAN) to generate modern art images.
• It uses three scripts:
• image_resizer.py – prepares/normalizes training images
• art_gan.py – defines the Generator & Discriminator, orchestrates training & image generation on Spell’s infrastructure
• view_data.py – visualizes outputs (sample images, loss curves)
File Structure
Top‐level files only:
• .gitignore – excludes virtual‐env & data files
• README.md – explains purpose, output, references
• image_resizer.py – preprocessing module
• art_gan.py – core ML training/generation module
• view_data.py – visualization module
No frontend/backend split here—this is a linear ML pipeline.
README Insights
• Confirms GAN training on Spell (cloud‐based experiment manager & GPU provisioning).
• Emphasizes outputs (generated images) and the ability to tweak hyperparameters.
Main Components & Their Interactions
a. Data Ingestion & Storage
• Raw image dataset (e.g., local folder or Spell‐mounted storage)
• Artifact store on Spell (to save models & generated images)
b. Preprocessing Module (image_resizer.py)
• Reads raw images → resizes & normalizes → writes to “processed dataset”
c. Training Module (art_gan.py)
• Imports processed dataset
• Defines Generator & Discriminator networks (e.g., using TensorFlow/PyTorch)
• Orchestrates training loop on GPU instances via Spell SDK/API
• Logs metrics (loss values) & checkpoints models to storage
• Generates sample art images at intervals
d. Visualization Module (view_data.py)
• Reads logged metrics & generated samples
• Produces plots (loss curves, image grids) for analysis
e. External Services / Infrastructure
• Spell Platform: job scheduling, GPU provisioning, storage mounts, experiment logging
• (Optional) GitHub for version control
Architectural Patterns & Design Principles
• Pipeline architecture: Data ingestion → Preprocessing → Training → Evaluation/Visualization
• Modular scripts: each script has single responsibility
• Use of external orchestration (Spell) to decouple compute management from code