Skip to content

Instantly share code, notes, and snippets.

View aGIToz's full-sized avatar
🐯

Amitoz Azad aGIToz

🐯
  • France
View GitHub Profile
@pmelchior
pmelchior / pytorch_pgm.py
Created December 30, 2018 23:23
Proximal Gradient Method for pytorch (minimal extension of pytorch.optim.SGD)
from torch.optim.sgd import SGD
from torch.optim.optimizer import required
class PGM(SGD):
def __init__(self, params, proxs, lr=required, momentum=0, dampening=0,
nesterov=False):
kwargs = dict(lr=lr, momentum=momentum, dampening=dampening, weight_decay=0, nesterov=nesterov)
super().__init__(params, **kwargs)
if len(proxs) != len(self.param_groups):
raise ValueError("Invalid length of argument proxs: {} instead of {}".format(len(proxs), len(self.param_groups)))
@FrancesCoronel
FrancesCoronel / sampleREADME.md
Last active March 26, 2024 01:21
A sample README for all your GitHub projects.

Repository Title Goes Here

Frances Coronel

INSERT GRAPHIC HERE (include hyperlink in image)

Subtitle or Short Description Goes Here

ideally one sentence >

@ilebedie
ilebedie / python_like_print.hpp
Created July 14, 2015 10:28
Python-like print in c++
#include <iostream>
using namespace std;
void print(){cout<<'\n';}
template<typename T, typename ...TAIL>
void print(const T &t, TAIL... tail)
{
cout<<t<<' ';