Conversation
afkanpour
left a comment
There was a problem hiding this comment.
Reviewed all commit messages.
Reviewable status: 0 of 1 files reviewed, 7 unresolved discussions (waiting on @Negiiiin)
openpmcvl/statistical_analysis/MMD.py line 10 at r1 (raw file):
From https://www.onurtunali.com/ml/2019/03/08/maximum-mean-discrepancy-in-machine-learning.html#formal-definition """ def MMD(x, y, kernel):
I believe the guideline says to use lowercase letters for function names.
openpmcvl/statistical_analysis/MMD.py line 15 at r1 (raw file):
Args: x: first sample, distribution P
Please specify dimension of x and y in the docstring.
openpmcvl/statistical_analysis/MMD.py line 19 at r1 (raw file):
kernel: kernel type such as "multiscale" or "rbf" """ xx, yy, zz = torch.mm(x, x.t()), torch.mm(y, y.t()), torch.mm(x, y.t())
How about xy instead of zz since it is x y^T?
Code quote:
zzopenpmcvl/statistical_analysis/MMD.py line 23 at r1 (raw file):
ry = (yy.diag().unsqueeze(0).expand_as(yy)) dxx = rx.t() + rx - 2. * xx # Used for A in (1)
What is "(1)"?
openpmcvl/statistical_analysis/MMD.py line 23 at r1 (raw file):
ry = (yy.diag().unsqueeze(0).expand_as(yy)) dxx = rx.t() + rx - 2. * xx # Used for A in (1)
Please update these comments and indicate what intermediate quantities are calculated here.
Code quote:
# Used for A in (1)openpmcvl/statistical_analysis/MMD.py line 27 at r1 (raw file):
dxy = rx.t() + ry - 2. * zz # Used for C in (1) XX, YY, XY = (torch.zeros(xx.shape).to(device),
Please use lowercase variable names everywhere.
openpmcvl/statistical_analysis/MMD.py line 54 at r1 (raw file):
""" Loads all .pt files in a directory and combines them into a matrix.
Please remove all instances of trailing whitespaces.
PR Type
[Feature ]
Short Description
Added MMD
This change is