This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.datasets import make_blobs | |
x_train, y_train = make_blobs(100, 2, 3) | |
# import matplotlib.pyplot as plt | |
# plt.scatter(x_train[:,0], x_train[:,1], c=y_train); | |
from sklearn.metrics import pairwise_distances | |
p_dist = pairwise_distances(x_train) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call plug#begin('~/.vim/plugged') | |
Plug 'lervag/vimtex' | |
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } | |
Plug 'vim-airline/vim-airline' | |
Plug 'cloudhead/neovim-fuzzy' | |
Plug 'w0rp/ale' | |
Plug 'vim-airline/vim-airline-themes' | |
Plug 'joshdick/onedark.vim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import sqrt | |
from math import log | |
from scipy.stats import gaussian_kde | |
def cs_divergence(p1, p2): | |
""" | |
Calculates the Cauchy-Schwarz divergence between two probabilities distribution. CS divergence is symmetrical, | |
hence the order of the arguments does not matter. The result is from interval [0, infinity], | |
where 0 is obtained when the two probabilities distributions are same. |