Skip to main content

Restricted Boltzmann Machine implementation in PyTorch

Project description

BoltzmaNN9

BoltzmaNN9 is a small toolkit for training Restricted Boltzmann Machines (RBMs) with a block-aware architecture, optional preprocessing, and a simple CLI for managing experiments.

Installation

  • Requires Python 3.10+ and PyTorch (CPU or CUDA).
  • From the repo root: python -m venv .venv && .venv/Scripts/Activate.ps1 (PowerShell) then pip install -e . or pip install -e ".[dev]" for linting/test extras.

CLI commands

  • python boltzmann9.py new_project <path> – scaffold a project with config.py, data/, output/, and a synthetic data generator.
  • python boltzmann9.py preprocess_raw --config <config.py> – run DataPreprocessor to turn raw CSV columns into binary features; relative paths in the config are resolved against the config file location.
  • python boltzmann9.py train --project <project_dir> – train an RBM using the project’s config.py; creates a timestamped run under output/.
  • python boltzmann9.py evaluate --run <run_dir or project_dir> – evaluate a saved run (defaults to the latest run if a project path is given).
  • python boltzmann9.py list --project <project_dir> – list available runs.

Configuration basics

config.py is a plain Python dict (see src/templates/config.py for a template):

  • device: "auto"/cpu/cuda:0/mps.
  • data: csv_path (training data), optional drop_cols.
  • model: visible/hidden block sizes, cross-block restrictions, initialization.
  • preprocess: quantile bounds, category limits, missing-bit toggles.
  • dataloader / train / eval / conditional: loader sizes, training hyperparameters, evaluation options. All relative paths in preprocessing are resolved relative to the config file; training also adjusts data.csv_path relative to the project directory.

Project template

python boltzmann9.py new_project demo_project creates:

  • demo_project/config.py – prefilled with the data path data/data.csv.
  • demo_project/data/synthetic_generator.py – generates a demo dataset and plot.
  • demo_project/output/ – destination for runs (run_<timestamp>).

Development

  • Run tests (if added): python -m pytest.
  • Lint (if installed): ruff check . and black --check ..
  • Key sources: boltzmann9.py (CLI), src/boltzmann/model.py (RBM), src/boltzmann/preprocessor.py (raw → binary), src/boltzmann/pipeline.py (training/eval flow).

See docs/QUICKSTART.md for a step-by-step guide and docs/TECHNICAL_DOCUMENTATION.md for module-level details.

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

boltzmann9-0.1.3.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

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

boltzmann9-0.1.3-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

Details for the file boltzmann9-0.1.3.tar.gz.

File metadata

  • Download URL: boltzmann9-0.1.3.tar.gz
  • Upload date:
  • Size: 33.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for boltzmann9-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d97b91fdb16a40e5224e1b5a8b81f3d531fd21f71643fe31ac9cc93369dcf286
MD5 cf66f747c4391ff53cd31582a642acff
BLAKE2b-256 b1f21ff65882cb35966a6e679f943f15ab8dfb8dd8f76ad8d4f6f931fd63abd8

See more details on using hashes here.

File details

Details for the file boltzmann9-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: boltzmann9-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 34.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for boltzmann9-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b5c45c0811e6a3c9edf2d812590a9fbcc7a561159cccb3f4fa61c2906edf0b4c
MD5 f7d31ba309db1c91de73ce5938e490c4
BLAKE2b-256 6d49a7546431a16afdd224e87536a631635b2f52464fd54355a5ce42908e0f0a

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