bafatah / ProxSPS

Polyak step sizes with weight decay in Pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Proximal Stochastic Polyak

arXiv

About

We develop a proximal stochastic Polyak method ProxSPS for stochastic optimization. The main focus is how to handle regularization for adaptive methods like the Polyak step size.

The methods SPS and ProxSPS from the paper are implemented in sps/sps.py. If you want to use ProxSPS, make sure to set prox=True, for example

from sps.sps import SPS
SPS(params, lr=1, weight_decay=1e-3, prox=True)

Experimental setup

The file configs.py contains all parameter configurations of the experiments. One or multiple experiments can be run with exp_main.py or with run_exp.ipynb. Simply specify in the list the experiment ids from configs.py that you would like to run, for example ['matrix_fac1', 'cifar10-resnet110']. Output is stored as a JSON file in the directory output and with the experiment id as filename.

The scripts automatically detects whether cuda is available and if so, runs on GPU.

Comments

The starting point for this repository was the offical SPS repository. However, we carried out several refactoring steps in the experimental setup. We also refactored the SPS optimizer in order to handle regularization.

About

Polyak step sizes with weight decay in Pytorch

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 98.6%Language:Jupyter Notebook 1.4%