How xjtuyw/pnp works
Project type and purpose
• This is a research-oriented deep learning training pipeline (Python/PyTorch) for “Generalized Class Discovery” (GCD).
• The codebase implements data ingestion, prototype-based clustering, a self-supervised prototype expansion mechanism, model architectures (ResNet, ViT, two-head ResNet), and training/evaluation scripts.
File structure
• Top-level scripts and executables:
• my_train.py – main training entry point
• cluster.py / estimate_k_gcd.py – clustering utilities
• config.py – global configuration and hyperparameters
• scripts/*.sh – bash wrappers to launch experiments on various datasets
• Core modules:
• data/ – dataset definitions (CIFAR, CARS, AIRCRAFT, HERBARIUM, PETS, IMAGENET, utilities for loading and batching)
• models/ – model definitions (ResNet variants, Vision Transformer, two-head designs)
• util/ – shared utilities (clustering and logging, general helper functions)
• Supporting:
• figs/ – method overview images (not part of runtime pipeline)
Key insights from the README
• The pipeline first clusters only unlabelled data, then augments prototypes via a learnable probing mechanism, optimizing end-to-end with prototypical contrastive learning.
• Scripts automate runs per dataset.
• Built atop an existing SimGCD codebase.
Elements
• another for model/training modules (e.g., green),
• a third for utility/configuration (e.g., gray),
• script/launcher as a separate parallelogram.