Skip to main content

Training and analyzing Restricted Boltzmann Machines in PyTorch

Project description

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

To install TorchRBM, you can use pip:

pip install .

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:

  • 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rbms-0.1.tar.gz (359.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rbms-0.1-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

Details for the file rbms-0.1.tar.gz.

File metadata

  • Download URL: rbms-0.1.tar.gz
  • Upload date:
  • Size: 359.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for rbms-0.1.tar.gz
Algorithm Hash digest
SHA256 aa940c2d42dfbbccf971e5a2daaadafa530664155c8f8bd5f0ffb3b87ed33aea
MD5 b4dc756afeb175baaa99bab22d97a5e4
BLAKE2b-256 a45f271e30d3487ad1dcc4f74ec38f6cc0485656b53fb383cdb417d9e90c0568

See more details on using hashes here.

File details

Details for the file rbms-0.1-py3-none-any.whl.

File metadata

  • Download URL: rbms-0.1-py3-none-any.whl
  • Upload date:
  • Size: 45.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for rbms-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 68ce863f8faaa3db2ba837149a9172a062d9ed188227d0b3fafef3778639de59
MD5 6ba0a8cae0104bf28cb4ec03139bb34c
BLAKE2b-256 31e83f51c1e86a33dda2e7b8972c78b808dffc633aff50cdbe053b1c4fa3aad1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page