Giter Site home page Giter Site logo

guided-spsa's Introduction

Guide-SPSA

This repository provides the experimental code for work "Guided-SPSA: Simultaneous Perturbation Stochastic Approximation assisted by the Parameter Shift Rule by M. Periyasamy et. al.". However, this repo is an initial experimental implementation of guided-spsa. For the installable module of the guided-spsa gradient evaluation, please refer to the following git repository "gspsa-gradients".

Setup and Installation

We recommend setting up a conda environment and install the required python packages using the environment.yml file:

conda env create -f environment.yml

Running the experiments

We use Hyrda to configure the experimental hyperparameters and run the respective experiments.

Regression

The default hyperparameters for the regression experiments are in the file "config_reg.yaml" under the directory "src/conf". One can adjust the hyperparameters and run the experiment as shown below:

python -u src/regression.py hydra/job_logging=disabled

All parameters in "config_reg.yaml" can also be adjusted during the Python execution as shown below:

python -u src/regression.py hydra/job_logging=disabled 'algorith_params.lr=0.03'

Classification

The default hyperparameters for the regression experiments are in the file "config_clas.yaml" under the directory "src/conf". One can adjust the hyperparameters and run the experiment as shown below:

python -u src/classification.py hydra/job_logging=disabled

All parameters in "config_clas.yaml" can also be adjusted during the Python execution as shown below:

python -u src/classification.py hydra/job_logging=disabled 'algorith_params.lr=0.03'

Acknowledgements

We use qiskit software framework: https://github.com/Qiskit

Citation

If you use the gspsa-gradients or results from the paper, please cite our work as

@misc{periyasamy2024guidedspsa,
      title={Guided-SPSA: Simultaneous Perturbation Stochastic Approximation assisted by the Parameter Shift Rule}, 
      author={Maniraman Periyasamy and Axel Plinge and Christopher Mutschler and Daniel D. Scherer and Wolfgang Mauerer},
      year={2024},
      eprint={2404.15751},
      archivePrefix={arXiv},
      primaryClass={quant-ph}
}

License

Apache 2.0 License

guided-spsa's People

Contributors

maniraman-periyasamy avatar sriranjanisriram avatar

Stargazers

Aaron Thomas 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.