Skip to main content

codecov pre-commit Static Badge

RBMs

Overview

rbms is a GPU-accelerated package designed to train and analyze Restricted Boltzmann Machines (RBMs). It is intended for students and researchers who need an efficient tool for working with RBMs. Features:

  • GPU Acceleration through PyTorch.
  • Multiple RBM Types: Supports Bernoulli-Bernoulli RBM and Potts-Bernoulli RBM.
  • Extensible Design: Provides an abstract class RBM with methods that can be implemented for new types of RBMs, minimizing the need to reimplement training algorithms, analysis methods, and sampling methods.

Installation

PyPI

rbms can be installed from PyPI:

pip install rbms

The last version on PyPI corresponds to the main branch of this repo. To update the installed package run

pip install rbms --upgrade

Github

If you want a more up-to-date version or wish to contribute, you can install the package directly from this repository:

git clone git@github.com:DsysDML/rbms.git
cd rbms && pip install -e .

If you want to update the package run

git pull

from inside the cloned repo.

Dependencies

The dependencies are included in the pyproject.toml file and should be compiled in the wheel distribution. If you have a GPU, make sure to install PyTorch with GPU support.

Usage

Main Classes and Functions:

  • EBM: An abstract class that provides the basic structure and methods for Energy-Based Models (EBMs).
  • RBM: An abstract class that provides the basic structure and methods for RBMs.
  • BBRBM: A concrete implementation of the Bernoulli-Bernoulli RBM.
  • PBRBM: A concrete implementation of the Potts-Bernoulli RBM.
  • rbms.sampling: Submodule for sampling methods.
  • rbms.training: Submodule for training algorithms.

Basic Example

Train a RBM on MNIST-01 with PCD-100 for 10 000 steps, using 200 hidden nodes and 2000 permanent chains:

rbms train  -d ./data/MNIST.h5 --subset_labels 0 1 \
--num_hiddens 200 --gibbs_steps 100 --num_chains 2000 \
--num_updates 10000 --filename ./RBM_MNIST01.h5

Documentation

The documentation is available at https://dsysdml.github.io/rbms/

Contributing

We welcome contributions to the development of TorchRBM. Here's how you can contribute:

  • Fork the Repository: Fork the main repository and make your changes.
  • Propose a Merge Request: Once your changes are complete, propose a merge request.
  • Testing: Ensure your code is tested using the pytest framework. Include your tests in the tests folder.
  • Code Style: Follow the pre-commit configuration for code style.
  • Documentation: Document your code using the Google docstring style and provide type hints .
  • Dependencies: Avoid adding extra dependencies unless absolutely necessary.

Support

If you encounter any issues, please open an issue on the main repository.

License

rbms is released under the MIT License.

Metadata

Release files for rbms 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for rbms 0.6.0
File Interpreter ABI Platform
rbms-0.6.0-py3-none-any.whl Python 3 none any Details

Release files / rbms-0.6.0-py3-none-any.whl

Download URL rbms-0.6.0-py3-none-any.whl
Size 83.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f7e42664556789a5c04d8b8d9dbec95ec8679ae621df2c353442849cc3e47b3
BLAKE2b-256 checksum
How to use checksums
b2dbb4b223f9bcfc3332dde73e8fbe858c11632644a6424d81e52a74025dcc5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":null,"id":"forky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.6.0 This release

1 release file

0.5.0

2 release files

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.2

1 release file

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page