(codes_g, codes_r, degree=3, gamma=None, coef0=1)
return _compute_mmd2(K_XX, K_XY, K_YY)
Compute MMD between two sets of features.

    Polynomial kernel given by:
    K(X, Y) = (gamma <X, Y> + coef0)^degree

    Args:
        codes_g (ndarray): Set of features from 1st distribution.
        codes_r (ndarray): Set of features from 2nd distribution.
        degree (int): Power of the kernel.
        gamma (float): Scaling factor of dot product.
        coeff0 (float): Constant factor of kernel.

    Returns:
        np.float64: Scalar MMD score between features of 2 distributions.
Compute MMD between two sets of features.
Compute MMD between two sets of features .
def polynomial_mmd(codes_g, codes_r, degree=3, gamma=None, coef0=1):
    """
    Compute MMD between two sets of features.

    Polynomial kernel given by:
    K(X, Y) = (gamma <X, Y> + coef0)^degree

    Args:
        codes_g (ndarray): Set of features from 1st distribution.
        codes_r (ndarray): Set of features from 2nd distribution.
        degree (int): Power of the kernel.
        gamma (float): Scaling factor of dot product.
        coeff0 (float): Constant factor of kernel.

    Returns:
        np.float64: Scalar MMD score between features of 2 distributions.
    """
    X = codes_g
    Y = codes_r

    K_XX = polynomial_kernel(X, degree=degree, gamma=gamma, coef0=coef0)
    K_YY = polynomial_kernel(Y, degree=degree, gamma=gamma, coef0=coef0)
    K_XY = polynomial_kernel(X, Y, degree=degree, gamma=gamma, coef0=coef0)

    return _compute_mmd2(K_XX, K_XY, K_YY)
def polynomial_mmd ( codes_g , codes_r , degree = 3 , gamma = None , coef0 = 1 ) : X = codes_g Y = codes_r K_XX = polynomial_kernel ( X , degree = degree , gamma = gamma , coef0 = coef0 ) K_YY = polynomial_kernel ( Y , degree = degree , gamma = gamma , coef0 = coef0 ) K_XY = polynomial_kernel ( X , Y , degree = degree , gamma = gamma , coef0 = coef0 ) return _compute_mmd2 ( K_XX , K_XY , K_YY )