Giter Club home page Giter Club logo

vr-proxskip's Introduction

VR-ProxSkip

This is the official code repository for NeurIPS 2022 paper: Variance Reduced ProxSkip: Algorithm, Theory and Application to Federated Learning

Requirement

We run each experiment with 64G CPU and Nvidia A100-80G GPU. The estimated running time for each experiments is 30min ~ 6hs (mostly relying on the number of maximum communication rounds).

We are required to install the following packages

python=3.8
optmethods
ray
psutil
numpy
matplotlib
copy
argparse
scikit-learn
urllib
other common package

After that, we need to modify one of the intalled optmethods functions in python package, Main change is to modify this function with the following code (should be in anaconda3/envs/$PROJECT_NAME$/lib/python3.8/site-packages/optmethods):

def compute_loss_of_iterates(self, return_loss_vals=False):
    for seed, loss_vals in self.loss_vals_all.items():
        if loss_vals is None:
            self.loss_vals_all[seed] = np.asarray([self.loss.value(x) for x in self.xs_all[seed]])
        else:
            warnings.warn("""Loss values for seed {} have already been computed. 
                Set .loss_vals_all[{}] = [] to recompute.""".format(seed, seed))
    self.loss_is_computed = True
    if return_loss_vals:
        return self.loss_vals_all[seed]

Convergence Analysis

We provide the code to compare VR-ProxSkip with baselines in `main_0002.py'. One optional script to run it is:

python main_0002.py --batch_size 16 --dataset 'a9a' --it_local 20 --choose_p 'kappa' --it_max 10001

Total Cost Ratio

The example script to obtain the total cost ratio:

python main_0004.py --batch_size 16 --cerr 1e-8 --regul 5e-4 --it_max 8000 --dataset 'a9a'

ProxSkip-QLSVRG

The example script to run ProxSkip-QLSVRG:

python main_0007.py --batch_size 16 --dataset 'a9a' --it_local 20 --choose_p 'kappa' --it_max 15001 --k 11

Citation

@article{vrproxskip2022,
  title={Variance reduced proxskip: Algorithm, theory and application to federated learning},
  author={Malinovsky, Grigory and Yi, Kai and Richt{\'a}rik, Peter},
  journal={Advances in Neural Information Processing Systems},
  volume={35},
  pages={15176--15189},
  year={2022}
}

Acknowledgement

This repo contains VR-ProxSkip related implementations building on top of opt_methods.

vr-proxskip's People

Contributors

williamyi96 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.