Skip to content

Instantly share code, notes, and snippets.

Avatar

Jesper Wohlert wohlert

View GitHub Profile
@wohlert
wohlert / Sinkhorn-solver.ipynb
Created Apr 3, 2019
Sinkhorn solver in PyTorch
View Sinkhorn-solver.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wohlert
wohlert / baselayer.py
Last active May 24, 2019
A metaprogramming approach with minimal overhead to perform Jacobian computation for arbitrary networks
View baselayer.py
"""
Registers jacobian for basic PyTorch layers
"""
import torch
from torch import nn
from .metric import register_jacobian
@register_jacobian(nn.Linear)
@wohlert
wohlert / Backpropagation.ipynb
Last active Oct 30, 2018
Tutorial describing backpropagation in a MLP
View Backpropagation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wohlert
wohlert / hmc.py
Created Jun 22, 2018
Hamiltonian Monte Carlo
View hmc.py
import numpy as np
class HamiltonianMC(object):
"""
Hamiltonian/hybrid Monte Carlo
Uses Hamiltonian dynamics to make proposals using
kinetic energy of the proposal. Employs leapfrog
integration for time-reversibility and to ensure