How xuwangyin/at-ebms works
• Data Preparation and Management:
• “prepare_datasets” directory (with shell scripts like create_celebahq256.sh and create_afhqcat256.sh) and associated download/extraction utilities. Also note that the datasets (e.g., CelebA-HQ, AFHQ, LSUN, CIFAR-10, tiny images) are external inputs managed via instructions in the README.
• Utility Modules:
• “GOOD/tiny_utils” folder (with various text files, configuration scripts like tiny_path_config.py, and data utilities for tiny images). This module provides helper routines and possibly configuration management for handling the 80M tiny images dataset.
• Model Definitions:
• Use the “models” folder (e.g., robustness_resnet_cifar10.py) and note that it is where the network architectures are defined.
• Training Engine:
• Adversarial Attack Modules:
• Components like “attack_steps.py” and “pgd_attack.py”. These modules implement adversarial aspects (for both generation and worst-case OOD detection) that are essential to the learning process.
• Evaluation and Generation:
• Experiment Management:
• Mention external directories (checkpoints, data, experiments) that need to be placed at the project root for reproducing results, as mentioned in the README.
• Additional Scripts and Modules:
• “dataset.py”, “misc.py”, “eval_utils.py”, and possibly components like “auto-attack” or “InNOutRobustness” (which might be additional modules for robustness evaluation or automatic attack generation).
• Data Preparation → Training Engine:
• Utility/Configuration → All Modules:
• Have the utility modules (tucked under GOOD/tiny_utils) feed configuration, support, or data handling functions to both training and evaluation stages.
• Model Definitions → Training Engine:
• The “models” module should be shown as a dependency of the training module. The training script instantiates these models according to the configurations and datasets.
• Adversarial Attacks → Training Engine and Evaluation:
• Generation and Evaluation:
• External Data Dependencies:
Architectural Patterns and Design Principles
• Modular Structure:
• That the project is modular by nature: Data preparation, training, model definition, adversarial module, and evaluation are kept largely separated to promote clarity and extensibility.
• Script-Driven Pipeline:
• Plug-and-Play Evaluation:
• That additional experiments (such as FID evaluation and 2D experiments via notebooks) are “plugged” into the core pipeline, marked as auxiliary evaluation components.
• Utilization of Popular Frameworks:
• Use of PyTorch/TorchVision for model training, possibly TensorFlow for FID scoring, and other libraries as mentioned in the README. They can be annotated next to relevant components (e.g., “models” and “train.py” rely on PyTorch).
• External datasets, pre-trained checkpoints, and scripts for dataset creation.
• Proceed to a “Processing” Layer:
• Training Engine centrally located, with its subsidiary modules (Models, Adversarial Attacks, Utility components) linked to it.
• End with an “Output/Evaluation” Layer:
• Evaluation modules that analyze generated images (FID), perform OOD detection, or generate experimental outputs.
• Every component and connection is clearly labeled to reflect the instructions in the README and the file tree structure.