Skip to content

Instantly share code, notes, and snippets.

View liguge's full-sized avatar
😆
On working

Chao He liguge

😆
On working
  • Beijing Jiaotong University
  • Beijing, China
View GitHub Profile
@liguge
liguge / central_mean_diescrepancy.py
Created November 23, 2022 06:53 — forked from yusuke0519/central_mean_diescrepancy.py
PyTorch implementation of central mean discrepancy (https://arxiv.org/abs/1702.08811)
# # -*- coding: utf-8 -*-
import itertools
from torch.utils import data
def l2diff(x1, x2):
"""
standard euclidean norm
"""
return ((x1-x2)**2).sum().sqrt()