Skip to content

Instantly share code, notes, and snippets.

View sergeyprokudin's full-sized avatar

Sergey Prokudin sergeyprokudin

  • ETH Zürich
  • Zürich
View GitHub Profile
####### LOSS FUNCTION #######
class MultivariateGaussianNegativeLogLikelihood(nn.Module):
def __init__(self):
super(MultivariateGaussianNegativeLogLikelihood, self).__init__()
def forward(self, pred_mean, pred_var, gt):
mu = pred_mean
logsigma = pred_var
mse = -0.5 * torch.sum(torch.square((gt - mu) / torch.exp(logsigma)), dim=1)
@pemagrg1
pemagrg1 / convert_envyml_to_reqtxt
Created April 22, 2020 17:51
convert environment.yml to requirement.txt
import ruamel.yaml
yaml = ruamel.yaml.YAML()
data = yaml.load(open('environment.yml'))
requirements = []
for dep in data['dependencies']:
if isinstance(dep, str):
package, package_version, python_version = dep.split('=')
if python_version == '0':
@mbsariyildiz
mbsariyildiz / .py
Last active March 8, 2024 20:44
Pairwise Euclidean distance computation of elements in 2 tensors, in TensorFlow.
def pairwise_dist (A, B):
"""
Computes pairwise distances between each elements of A and each elements of B.
Args:
A, [m,d] matrix
B, [n,d] matrix
Returns:
D, [m,n] matrix of pairwise distances
@kevin-keraudren
kevin-keraudren / Conferences.md
Last active June 24, 2024 08:47
List of conferences in Medical Imaging and Computer Vision

Conferences in Medical Imaging/Computer Vision

MICCAI: Medical Image Computing and Computer Assisted Intervention

http://www.miccai.org/

BMVC: British Machine Vision Conference