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) thenpip install -e .orpip install -e ".[dev]"for linting/test extras.
CLI commands
python boltzmann9.py new_project <path>– scaffold a project withconfig.py,data/,output/, and a synthetic data generator.python boltzmann9.py preprocess_raw --config <config.py>– runDataPreprocessorto 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’sconfig.py; creates a timestamped run underoutput/.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), optionaldrop_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 adjustsdata.csv_pathrelative to the project directory.
Project template
python boltzmann9.py new_project demo_project creates:
demo_project/config.py– prefilled with the data pathdata/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 .andblack --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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file boltzmann9-0.1.1.tar.gz.
File metadata
- Download URL: boltzmann9-0.1.1.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8f08e65d72f4125be970b910735ba1e5d0abf37167a0fa6c5d3500fb485609f
|
|
| MD5 |
bff883abff3262eb52d9273339172461
|
|
| BLAKE2b-256 |
c3141ec9b26d4a91df99a0ae2d0a3beb38e3a21d0dced1d851174903a456d4bb
|
File details
Details for the file boltzmann9-0.1.1-py3-none-any.whl.
File metadata
- Download URL: boltzmann9-0.1.1-py3-none-any.whl
- Upload date:
- Size: 34.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56080918a5a8e77f40a74ef851c81d7e6b0465bd7ba2efafebb877ceaa6c1591
|
|
| MD5 |
60d559dda10e4f6af112dcee3f8d91cf
|
|
| BLAKE2b-256 |
ab3449e66c21b7a69cd59ef151f831d4a1c2bd779a51b840adfcf20271f9d2e2
|