Skip to content

Home

Python application test Coverage Documentation Status PyPI - Python Version PyPI DOI

pyrkm banner pyrkm banner

What is a Restricted Kirchhoff Machine?

You may be familiar with Restricted Boltzmann Machines (RBMs) [1]-[2], which are a type of generative neural network that can learn a probability distribution over its input data. The Restricted Kirchhoff Machine (RKM) is a realization of a RBM using resistor networks, and Kirchhoff's laws of electrical circuits. In this repository, we provide a Python package to virtually simulate the training and evaluation of RKMs.

For more information about the capabilities of the RKM, see the original paper by Link to arXiv paper.

Repository Contents

In this repository you will find the following:

  • src/pyrkm/: The main package code. You can use this code to train and evaluate RKMs. For more information, see the documentation. For a quick start, see the Usage section below.
  • energy_consumption: A series of scripts to evaluate the energy consumption of the RKM and compare it to the estimated cost of a RBM. They are used to generate the results in the paper.

Getting Started

To get started with the project, follow these steps:

  • Prerequisites: In order to correctly install pyrkm you need python3.9 or higher. If you don't have it installed, you can download it from the official website.

  • Install the package:

    python -m pip install pyrkm
    

  • Or: Clone the repository:

    git clone https://github.com/Kirchhoff-Machines/pyrkm.git
    cd pyrkm
    git submodule init
    git submodule update
    pip install .
    

Usage

To learn how to use the package, follow the official documentation and in particular this tutorial.

Contribution Guidelines

We welcome contributions to improve and expand the capabilities of this project. If you have ideas, bug fixes, or enhancements, please submit a pull request. Check out our Contributing Guidelines to get started with development.

Generative-AI Disclaimer

Parts of the code have been generated and/or refined using GitHub Copilot. All AI-output has been verified for correctness, accuracy and completeness, revised where needed, and approved by the author(s).

How to cite

Please consider citing this software that is published in Zenodo under the DOI 10.5281/zenodo.14865380.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.