Skip to content

Instantly share code, notes, and snippets.

View jpcbertoldo's full-sized avatar
:shipit:

Joao P C Bertoldo jpcbertoldo

:shipit:
View GitHub Profile
@ctralie
ctralie / testOt.py
Created November 14, 2018 01:43
2D Histogram Wasserstein Distance via POT Library
"""
Programmer: Chris Tralie
Purpose: To use the POT library (https://github.com/rflamary/POT)
to compute the Entropic regularized Wasserstein distance
between points on a 2D grid
"""
import numpy as np
import matplotlib.pyplot as plt
import ot
@rwightman
rwightman / median_pool.py
Last active May 3, 2024 09:03
PyTorch MedianPool (MedianFilter)
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.utils import _pair, _quadruple
class MedianPool2d(nn.Module):
""" Median pool (usable as median filter when stride=1) module.