# On the Representation Power of Set Pooling Networks

This code is for the purpose of empirically testing ideas from the paper "On the Representation Power of Set Pooling Networks." In particular, it tests the mathematically proven error lower-bound for PointNet and also performs and experiment on inductive bias. These experiments are done in Python and requires Pytorch. We test the established error lower-bound by training a PointNet model on 2D point clouds and then using the strategy in the proof to produce point clouds which demonstrate the failure of PointNet to uniformly approximate the center-of-mass function. For the inductive bias experiment we create two synthetic binary classification datasets RingLine and DiscSquare: the former proves virtually impossible for PointNet to crack but easy for DeepSets, and conversely the latter proves easy for PointNet but hard for DeepSets. 

The files containing code in this project are

- `sampler.py`: Contains code for producing samplings of different shapes 
- `datasets.py`: Contains code for the synthetic PyTorch 'dataset' which are used in the experiments.
- `models.py`: Contains code for set pooling networks to be used in the experiments.
- `train_CoM.py`: Run this to train a PointNet model to (try) to learn the center-of-mass function. The training parameters, architecture, and number of training examples can be edited via text editor. Produces a saved model and training curve plot which are stored in a corresponding directory. 
- `test_lower_bound.py`: Run this after `train_CoM.py` to generate the problematic examples for the previously saved model produced by `train.py`. Also saves a figure showing the errors that are discovered via this method as compared to the ensured sup-norm error lower bound.
- `test_inductivebias.py`: Run to have PointNet and DeepSets train to try and solve the RingLine & DiscSquare datasets. 

Reminder: The `train.py` script should be ran before `test_lower_bound.py`. Additionally, a directory is included from one such run which includes a model, training and experiment results titled `numclds_1000000`.