################################################################################
#######   Code to run experiments for Learning with Stochastic Orders   ########
################################################################################

################################################################################
# The code is released exclusively for review purposes with the following terms:
# PROPRIETARY AND CONFIDENTIAL. UNAUTHORIZED USE, COPYING, OR DISTRIBUTION OF THE CODE,
# VIA ANY MEDIUM, IS STRICTLY PROHIBITED. BY ACCESSING THE CODE, THE REVIEWERS AGREE TO
# DELETE THEM FROM ALL MEDIA AFTER THE REVIEW PERIOD IS OVER.

# This repository is intended for reviewers to have access to the code that generated results
# and plots in the paper submission.
################################################################################

### Install
conda env create -f gmorder_env.yml
conda activate gmorder_env

# Please note, if you are creating this environment on macOS, you will need to either remove the 'cudatoolkits'
# dependency from the yml file or reduce the version to a previous build number that supported macOS
# (e.g., 'cudatoolkits==9.0').

################################################################################

### Instructions to run 1D portfolio optimization (CPU)
jupyter notebook notebooks/portfolio_optimization.ipynb
# Execute all cells

################################################################################

### Instructions to run 2D d_CT generation (CPU)
sh run_choquet_train_distributions.sh
# Open this script and change 'data' (Line 7) to one of 'circle_of_gaussians', 'swiss_roll', 'image_point_cloud'

################################################################################

### Instructions to run Cifar-10 VDC generation (GPU)
# A baseline WGAN-GP model is already provided here in: ./saved_models/images/cifar10/wgan/lightning_logs/version_0/,
# however you can re-train a baseline by running `sh run_wgan_train_images.sh`.
# To reproduce the WGAN-GP + VDC results from the paper, execute:
sh run_wgan_dominate_images.sh

# Please note, if running this experiment on a non-CUDA enabled machine, change the 'device' (Line 39)
# in 'run_wgan_dominate_images.sh' to "cpu".