Skip to content

Instantly share code, notes, and snippets.

View akanimax's full-sized avatar
🐢
... GNIVIL

Animesh Karnewar akanimax

🐢
... GNIVIL
View GitHub Profile
@jojonki
jojonki / ema.py
Last active March 13, 2020 05:18
Apply exponential moving average decay for variables in PyTorch
# How to apply exponential moving average decay for variables?
# https://discuss.pytorch.org/t/how-to-apply-exponential-moving-average-decay-for-variables/10856/2
class EMA(nn.Module):
def __init__(self, mu):
super(EMA, self).__init__()
self.mu = mu
def forward(self,x, last_average):
new_average = self.mu*x + (1-self.mu)*last_average
return new_average
@wiseodd
wiseodd / gan.py
Last active September 1, 2020 10:22
Generative Adversarial Nets (GAN) implementation in TensorFlow using MNIST Data.
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import os
def xavier_init(size):
in_dim = size[0]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: