Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Registers jacobian for basic PyTorch layers | |
""" | |
import torch | |
from torch import nn | |
from .metric import register_jacobian | |
@register_jacobian(nn.Linear) |