Skip to content

Instantly share code, notes, and snippets.

View vvanirudh's full-sized avatar
💭
I may be slow to respond.

Anirudh Vemula vvanirudh

💭
I may be slow to respond.
View GitHub Profile
@vvanirudh
vvanirudh / bayes_by_backprop.py
Last active July 25, 2022 11:26
Bayes by Backprop in PyTorch (introduced in the paper "Weight uncertainty in Neural Networks", Blundell et. al. 2015)
# Drawn from https://gist.github.com/rocknrollnerd/c5af642cf217971d93f499e8f70fcb72 (in Theano)
# This is implemented in PyTorch
# Author : Anirudh Vemula
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
from sklearn.datasets import fetch_mldata
@vvanirudh
vvanirudh / gan_1d.py
Created April 26, 2017 20:07
GAN to model a 1D gaussian distribution
# Drawn from https://gist.github.com/rocknrollnerd/06bfed6b9d1bce612fd6 (in theano)
# This is implemented in PyTorch
# Author : Anirudh Vemula
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
from scipy.stats import norm
import matplotlib.pyplot as plt