Skip to content

Instantly share code, notes, and snippets.

@snowyday
snowyday / mnist_dist.py
Last active February 17, 2019 14:19
Distributed MNIST with Ignite
from argparse import ArgumentParser
import torch
from torch import nn
import torch.nn.functional as F
from torch.optim import SGD
import torch.utils.data
# === ADDED FOR DISTRIBUTED >>>
import torch.distributed
@snowyday
snowyday / loss_to_eve.py
Last active April 24, 2017 21:40
Usage of eve
optimizer = optim.Eve(model.parameters())
optimizer.step(lambda: loss)
@snowyday
snowyday / eve.py
Last active January 16, 2018 04:26
Eve: Improving Stochastic Gradient Descent with Feedback
import math
from torch.optim import Optimizer
class Eve(Optimizer):
"""Implements Eve (Adam with feedback) algorithm.
It has been proposed in `Improving Stochastic Gradient Descent with Feedback, `_.
Arguments:
params (iterable): iterable of parameters to optimize or dicts defining