A modular framework for training and evaluating set- and graph-based neural models — including MasNet, ReLUMasNet, DeepSets, and SetTransformer — on benchmark tasks such as FacilityLocation and SubSet. Built on PyTorch Lightning, the framework provides reproducible training, automatic checkpointing, and optional out-of-distribution (OOD) evaluation.
- Unified interface for multiple architectures
- Simple configuration via command-line arguments
- PyTorch Lightning integration for clean training loops
- Automatic OOD evaluation by doubling the input dimension
- Reproducible experiments with fixed random seeds
git clone https://github.com/yonatansverdlov/Monotone-Embedding.git
cd <your_repo>
pip install -r requirements.txt(Make sure torch, pytorch-lightning, and easydict are included in your requirements.txt.)
cd data
python msweb_data_generator.py --DATASET_NAME MSWEB
python msweb_data_generator.py --DATASET_NAME MSWEBcd data
python amazon.py --dataset_name bedding/feedingcd data
python pointcloud.py --s1_size 128 & python pointcloud.py --s1_size 256 & python pointcloud.py --s1_size 128./run_datasets.sh./run_pointcloud.shpython main.py --task_type FacilityLocation --model_type MasNetpython main.py --task_type SubSet --model_type SetTransformerpython main.py --model_type ReLUMasNet --test_dist| Argument | Type | Default | Description |
|---|---|---|---|
--task_type |
str | FacilityLocation |
Task name (FacilityLocation or SubSet) |
--model_type |
str | MasNet |
Model architecture (ReLUMasNet, DeepSets, MasNet, SetTransformer) |
Starting training...
Model MasNet | Task: FacilityLocation | m: 10, n: 20, d: 4 | Accuracy: 91.24 | OOD Accuracy: 84.67
Final Results Summary:
m: 10, n: 20, d: 4 -> Test Accuracy: 91.24 | Out-of-distribution: 84.67
.
├── main.py
├── lightning_model.py
├── utils.py
├── requirements.txt
├── README.md
└── data/
If you use this repository in your research, please cite:
@misc{graphmodels2025,
author = {Sverdlov, Yonatan},
title = {Graph Model Training Framework},
year = {2025},
note = {Technion – Israel Institute of Technology}
}
Pull requests are welcome!
To add a new model:
- Implement it in
lightning_model.pyor create a new file undermodels/. - Register it inside
get_args()inutils.py. - Run and test with
python main.py --model_type YourModelName.
MIT License © 2025 Yonatan Sverdlov