The project aims to visualize the divergence minimization problem in a 2D space. The user can choose different divergence measures, target distributions, and optimizer algorithms to visualize the minimization process.
Install the required packages using the following command:
pip install -r requirements.txt- The target gaussian distributions can be specified in the
target_distribution_configfile. Each row in the file represents a target distribution. The first column is the mean of the distribution, and the second column is the standard deviation. For example, the following line specifies two Gaussian distribution with mean 0 and 1, and standard deviation 1.
mu,std
0,1
1,1
- Execute the following command to start the execution of the program:
python main.py- The following arguments can be used to specify the divergence measure, target distribution, and optimizer algorithm:
python main.py \
--distance_measure <divergence measurement> \
--sample_num <number of samples when meansuring the divergence> \
--iter_num <number of training iterations> \
--lr <learning rate> \
--optimizer <optimizer used to update the paramenter> \Here are the different options for the arguments:
distance_measure: The divergence measure used to measure the difference between the target and the generated distribution. The options arefkl,rkl,jsd, andw2.optimizer: The optimizer used to update the parameters. The options aresgd,adam. More sample command can be found in therun_code.shfile.
The program will generate a loss curve, a result distribution, and a gif visualizing the divergence minimization process. These files will be saved in the results folder.
- minimization process
- loss curve
- result distribution
- minimization process
- loss curve
- result distribution





