Pytorch implementation of our Partially Convex Potential Maps. The model constructs partially monotone transport maps between probability measures as gradients of partially input convex neural networks (PICNN).
We test PCP-Map's performance on learning both the map between joint probability measures (by constructing a block triangular transport map) with the addition of a fully input convex neural networks (FICNN) and the between conditional measures. Note that for some of the following scripts, users have to set the appropriate arguments in the parser based on to which dataset they are learning. Moreover, users in some occasions need to fill in the absolute paths of files.
Paper: https://arxiv.org/abs/2310.16975
To run some files (e.g. the tests), you may need to add them to the path via
export PYTHONPATH="${PYTHONPATH}:."
Due to copyright concerns, we did not provide the required datasets. They can be downloaded from the UC Irvine Machine Learning Repository.
After downloading, please specify the paths to these datasets in file 'datasets/tabular_data.py' for loading purposes.
python pretrain_cond.py --data 'concrete' --input_x_dim 1 --input_y_dim 8
python pretrain_cond.py --data 'energy' --input_x_dim 1 --input_y_dim 9
python pretrain_cond.py --data 'yacht' --input_x_dim 1 --input_y_dim 6
python pretrain_joint.py --data 'parkinson' --input_x_dim 8 --input_y_dim 7
python pretrain_joint.py --data 'rd_wine' --input_x_dim 6 --input_y_dim 5
python pretrain_joint.py --data 'wt_wine' --input_x_dim 6 --input_y_dim 5
Before running following scripts, please change accordingly to correct file paths when loading datasets and hyperparameter combinations
python experiment_tab_cond.py
python experiment_tab_joint.py
Evaluate the trained model
python evaluate_cond.py
python evaluate_joint.py
Before running this script, change to correct absolute path for storing the dataset
python sample_stoch_lv.py
Before running following script, please change accordingly to correct file paths when loading datasets
python pretrain_cond.py --data 'lv' --input_x_dim 4 --input_y_dim 9
Before running following script, please change accordingly to correct file paths when loading datasets and hyperparameter combinations
python experiment_lv.py
Before running following script, please change accordingly to correct file paths
python evaluate_lv.py
Please change the "path_to_fcode" variable in "simulator.py" to the correct absolute path to "shallow_water01_modified.f90".
Change the "--path_to_save" argument in "sample_shallow_water.py" to correct paths
for k in 1 2 3 4 5 6 7 8 9 10
do
python sample_shallow_water.py --job_num $k
done
Before running following script, please change accordingly to correct file paths when loading datasets
python shallow_water.py
The datasets used for the associated paper can be found through https://drive.google.com/drive/folders/1ObuuATIEsC3z9d0S_WRp2lGZVOClu0Ip?usp=drive_link. Note that the datasets here contain already projected, 3500-dimensional, observations "y".
python pretrain_cond.py --data 'sw' --input_x_dim 100 --input_y_dim 3500 --theta_pca 1
Before running following script, please change accordingly to correct file paths when loading hyperparameter combinations
python experiment_sw.py
Before running following script, please change accordingly to correct file paths
python evaluate_sw.py