How berndprach/1lipschitzlayerscompared works
This repository compares 1-Lipschitz neural-network layers through configured training runs, hyperparameter search, and measurements of accuracy, speed, memory, and Lipschitz bounds. The principal workflow is to define or generate settings, load datasets and construct a model, train and record metrics, then select hyperparameters and train final models. It also exposes reusable layers and pretrained models. Training internals are only partly sampled, so links not established by the excerpts or README are omitted; documented capabilities with unsampled implementations are represented at their known paths.
Main entry points: train_module.py Training loop · train.py Training command · make_tree.py Run settings · eval_best_lr_wd.py Best hyperparameters
Components 20
Experiment setup
- Run settings
make_tree.py - Settings parser
utils/parsers/setting_parser.py - Epoch estimator
epoch_budget_estimator.py
Model and training
- Training command
train.py - Training loop
trainer/train_module.py - Datasets and loaders
datasets - Training metrics
trainer/metrics
Evaluation and results
- Run statistics
utils/statistics/statistics_handler.py - Run artifacts
utils/results/read_results.py - Best hyperparameters
eval_best_lr_wd.py - Robust accuracy
evaluator/robust_accuracy.py - Lipschitz analysis
evaluator/lipschitz_constant.py - Batch timing
evaluator/batch_times.py - Memory measurement
evaluator/memory_usage.py
Reusable models
- Classifier models
models - LipConvNet
lipnn/lip_conv_net.py - 1-Lipschitz layers
models/layers/lipschitz - Pretrained models
hubconf.py
Other components
- Researcher
- Torch Hub
Connections 21
- Researcher → Run settings: generates settings
- Researcher → Epoch estimator: estimates epochs
- Researcher → Training command: starts runs
- Run settings → Settings parser: writes configuration
- Training command → Settings parser: loads settings
- Training command → Training loop: starts training
- Training loop → Datasets and loaders: gets loaders
- Training loop → Classifier models: trains model
- Training loop → Training metrics: evaluates batches
- Training loop → Run statistics: records metrics
- Classifier models → 1-Lipschitz layers: uses layers
- LipConvNet → 1-Lipschitz layers: uses layers
- Training loop → Lipschitz analysis: bounds Lipschitz
- Run artifacts → Run statistics: reads run data
- Best hyperparameters → Run artifacts: selects run metrics
- Best hyperparameters → Run settings: supplies hyperparameters
- Researcher → Robust accuracy: evaluates robustness
- Researcher → Batch timing: measures speed
- Researcher → Memory measurement: measures memory
- Torch Hub → Pretrained models: loads models
- Pretrained models → LipConvNet: constructs models