This code reproduces the figures and experiments appearing in our manuscript titled
"Neural Injective Functions for Multisets, Measures and Graphs via a Finite Witness Theorem"

=== A. Graph Separation ===
To reproduce the graph separation results of Figure 1(a) and Figure 4,
run the Jupyter notebook graph_separation.ipynb. We recommend using Google Colab.

 === B. ReLU vs SiLU  ===
To reproduce the plots of Figure 1(b), run relu_vs_silu.ipynb.

=== C. Empirical Injectivity ===
To reproduce the empirical injectivity and bi-Lipschitzness experiment of Figurs 2 and 3:

1) Install pytorch
2) From the ./empirical injectivity subdirectory, run one of the following tests.
   These reproduces all results appear in Figure 3.
   The third test (d=3, n=1000) reproduces the results in Figure 2.

python test_injectivity.py --testName injectivity_d3_n10    --d 3   --n 10   --nSamples 20 --nReps 100000
python test_injectivity.py --testName injectivity_d3_n100   --d 3   --n 100  --nSamples 20 --nReps 100000
python test_injectivity.py --testName injectivity_d3_n1000  --d 3   --n 1000 --nSamples 20 --nReps 25000
python test_injectivity.py --testName injectivity_d100_n10  --d 100 --n 10   --nSamples 20 --nReps 25000
python test_injectivity.py --testName injectivity_d100_n100 --d 100 --n 100  --nSamples 20 --nReps 25000

The output is saved to the ./out subdirectory (under ./empirical_injectivity).

Output files:
<test_name>.log: A log of the text output produced during runtime. 
                 Gets continually updated as the program runs.

<test_name>.csv: A .csv file containing the summarized results.
                 Columns: 'm' - embedding dimension; nSamples: Number of independent instances tested;
                          'min_max_ratio_<activation name>': The ratio c/C as appears in the graph, with c and C being the
						       minimum and maximum of r(X_1,X_2) over all instances.
							   See Appendix E.1 for the definition of r(X_1,X_2).
                          'min_mean_ratio_<activation name>': The ratio between the minimum and the mean of r(X_1,X_2).
                          'mean_max_ratio_<activation name>': The ratio between the mean and the maximum of r(X_1,X_2).

<test_name>_temp.csv: Same as <test_name>.csv, but this file is continually updated as the program runs.

Requirements:
This code can be run on a CPU or a GPU, but naturally runs faster on a GPU.
The program reports which device is uses in the text output and the .log file.

