Recommended: Graph-tool one-line install commands:
anaconda
conda create --name gt -c conda-forge graph-tool
homebrew
brew install graph-tool
| import math | |
| import torch | |
| import torch.linalg as linalg | |
| def calculate_2_wasserstein_dist(X, Y): | |
| ''' | |
| Calulates the two components of the 2-Wasserstein metric: | |
| The general formula is given by: d(P_X, P_Y) = min_{X, Y} E[|X-Y|^2] | |
| For multivariate gaussian distributed inputs z_X ~ MN(mu_X, cov_X) and z_Y ~ MN(mu_Y, cov_Y), |
| #!/bin/sh | |
| # This is a pre-commit hook that ensures attempts to commit files that | |
| # are larger than 100 MB to your _local_ repo fail, with a helpful error | |
| # message. | |
| # | |
| # This prevents the local repo from getting out of sync with the Github | |
| # repo. To install | |
| # 1) Change this file to executable: | |
| # $ chmod a+x pre-commit |