Instructions to use the code:


Required standard python packages:

pickle
numpy
tqdm 
torch
torch_geometric
time
matplotlib
os
argparse
networkx
GraphRicciCurvature
scipy
shutil
pandas
gudhi


Required additional software (all included in the main folder except Mathematica):

Function_Delaunay, compile: -> go to folder -> cmake -> make
Mpfree, compile: -> go to folder -> cmake -> make
Graphcode, compile: -> go to folder -> cmake -> make
Multipers, see https://github.com/DavidLapous/multipers/ for installation instructions
GRIL/MPML, see https://github.com/TDA-Jyamiti/GRIL/ for installation instructions
Wolfram Mathematica


The software to generate the datasets can be used as follows: (we used the random seeds set in all the scripts for our experiments)

To generate a random pointcloud datasets (Shape,Orbit) uncomment the required section and run the python script "generate_pointcloud_dataset.py". It generates a folder "Pointcloud_Dataset" in the "Data" directory containing the pointcloud files and a pickle file containing the labels. To visualize an example pointcloud uncomment the labeled section in the python script. To compute the Process dataset run first the Mathematica notebook "point_processes.nb". It creates folders containing the samples of 3 of the point processes and writes them to the Data directory. Then run the corresponding section in the "generate_pointcloud_dataset.py" file. 

To compute minimal presentations of function_delauny bifiltrations of these pointclouds with local density estimates run the shell script "generate_presentations_from_pointclouds.sh". It generates a folder "Pointcloud_Presentations" in the "Data" directory containing the scc files of the presentations. 

To compute the graphcodes of the minimal presentations of these bifiltrations, uncomment the required section corresponding to Shape, Processes and Orbit, and run the shell script "generate_graphs_from_presentations_pointcloud.sh". It generates a folder "Pointcloud_Graphs" in the "Data" directory containing the computed graphcodes. To compute graphcodes with exhaustive column reduction or random base shuffles uncomment the respective line in "generate_graphs_from_presentations_pointcloud.sh".

To compute a torch_geometric graph dataset from the graphcode files and pointcloud labels uncommend the "pointcloud" line and run the python script "build_torch_graphdataset.py". It computes a pickle file containing a list of torch_geometric graphs and writes it to the "Data" directory. 

To compute persistence images based on one-parameter alpha filtrations of the pointclouds run the python script "generate_persistence_images.py". It computes persistence images from the pointclouds in the "Pointcloud_Dataset" folder and writes them to a pickle file in the "Data" directory.

To compute multiparameter persistence images, landscapes or signed measure convolutions run the python script "multipers_vectorizations_from_scc.py". Uncomment the respective line to compute all of these vectorizations at once or a specific type of vectorization. The vectorizations are computed from minimal presentations in the "Pointcloud_Presentations" folder and written to a pickle file in the "Data" directory. These computations are based on the multipers package which has to be installed. 

To compute multiparameter generalized rank invariant landscapes, first run the shell script "generate_filtrations_from_points.sh". It computes function_delauny filtration files from the pointcloud files in the "Pointcloud_Dataset" folder and writes them to a folder "Filtration_Dataset" in the "Data" directory. Next run the python script "generate_GRIL_inputs.py". It computes a pickle file of inputs suitable for the GRIL package, which has to be installed for the next step, and writes it to the "Data" directory. To compute the GRIL landscapes go to the MPML folder and run the python script "compute_GRIL_landscapes.py" there. It computes the GRIL landscapes and writes them to a file in the "Data" directory.    

To generate heat-kernel-Ricci-curvature bifiltrations of graphs of the TUDatasets uncomment the name of the dataset and run the python script "generate_graph_bifiltrations.py". It generates a folder "Graph_Bifiltrations" in the "Data" directory containing the bifiltration files and a pickle file containing the corresponding labels. 

To compute minimal presentations of these bifiltrations run the shell script "generate_presentations_from_graph_bifiltrations.sh". It generates a folder "Graph_Presentations" in the "Data" directory containing the scc files of the minimal presentations.  

To compute the graphcodes of the minimal presentations of these graph bifiltrations run the shell script "generate_graphs_from_presentations_graph.sh". It generates a folder "Graph_Graphs" in the "Data" directory containing the computed graphcodes.

To compute a torch_geometric graph dataset from the graphcode files and labels uncommend the "graphs" line and run the python script "build_torch_graphdataset.py". It computes a pickle file containing a list of torch_geometric graphs and writes it to the "Data" directory. 

The graph neural network model used in the experiments is in the python file "gnn_model.py". The parameters used in the various experiments are at the end of the file. 

The convolutional neural network model used in the experiment is in the python file "cnn_model.py". The parameters used in the various experiments are at the end of the file. 


