This repository is the official implementation of PLLay: Efficient Topological Layer based on Persistence Landscapes.
Kwangho Kim, Jisu Kim, Manzil Zaheer, Joon Sik Kim, Frederic Chazal, Larry Wasserman
PLLay imports the following libraries:
- gudhi(>=3.2.0)
- numpy
- sklearn
- tensorflow(>=2.0.0)
- time
This repository contains two experiments, one on MNIST dataset and another on ORBIT5K dataset, both with noise and corruption added. The experiment for MNIST dataset is under mnist directory, and the experiment for ORBIT5K dataset is under orbit5k directory. Each experiment consists of: generating data, preprocessing, training, evaluation, and training with evaluation for SLay. All the hyperparameters used in the experiments are specified in the python code.
This is to generate datasets and add noise and/or corruption. To generate data, run these commands:
python mnist_generate_data.py
python orbit5k_generate_data.py
This is to compute landscapes in advance. To preprocess data, run these commands:
python mnist_preprocess.py
python orbit5k_preprocess.py
To train the models using PLLay in the paper, run this command:
python mnist_train.py
python orbit5k_train.py
After training, the models are saved at the designated location. In this repository, those pre-trained models can be downloaded at MNIST models and ORBIT5K models, respectively.
To evaluate the trained models using PLLay, in the paper, run this command:
python mnist_eval.py
python orbit5k_eval.py
In the paper, we also considered SLay for the comparison. For SLay, we don't generate pre-defined models but we train and evaluate together. To train and evaluate models using SLay in the paper, run this command:
python mnist_train_eval_slay.py
python orbit5k_train_eval_slay.py
Our model achieves the following performance on MNIST dataset:
And our model achieves the following performance on ORBIT5K dataset: