RestrictedBoltzmannMachines

Train and sample Restricted Boltzmann machines in Julia

https://github.com/cossio/restrictedboltzmannmachines.jl

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: aps.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.7%) to scientific vocabulary

Keywords

julia machine-learning rbm

Keywords from Contributors

flux the-human-brain interpretability pde optim meshing projections matrix-exponential network-simulation hacking
Last synced: 6 months ago · JSON representation ·

Repository

Train and sample Restricted Boltzmann machines in Julia

Basic Info
  • Host: GitHub
  • Owner: cossio
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: master
  • Homepage:
  • Size: 626 MB
Statistics
  • Stars: 19
  • Watchers: 3
  • Forks: 4
  • Open Issues: 2
  • Releases: 140
Topics
julia machine-learning rbm
Created over 5 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Citation

README.md

RestrictedBoltzmannMachines Julia package

Train and sample Restricted Boltzmann machines in Julia.

Installation

This package is registered. Install with:

julia import Pkg Pkg.add("RestrictedBoltzmannMachines")

This package does not export any symbols. Since the name RestrictedBoltzmannMachines is long, it can be imported as:

julia import RestrictedBoltzmannMachines as RBMs

Usage with CUDA

We define two functions, cpu and gpu (similar to Flux.jl), to move RBM to/from the CPU and GPU.

```julia import CUDA # if you want to use the GPU, need to import this using RestrictedBoltzmannMachines: BinaryRBM, cpu, gpu

rbm = BinaryRBM(randn(5), randn(3), randn(5,3)) # in CPU

copy to GPU

rbm_cu = gpu(rbm)

... do some things with rbm_cu on the GPU (e.g. training, sampling)

copy back to CPU

rbm = cpu(rbm_cu) ```

See this Google Colab notebook for a full example of training and sampling an RBM with GPU.

CenteredRBM

Train and sample centered Restricted Boltzmann machines in Julia. See [Melchior et al] for the definition of centered. Consider an RBM with binary units. Then the centered variant has energy defined by:

$$ E(v,h) = -\sumi ai vi - \sum\mu b\mu h\mu - \sum{i\mu} w{i\mu} (vi - ci) (h\mu - d\mu) $$

with offset parameters $ci,d\mu$. Typically $ci,d\mu$ are set to approximate the average activities of $vi$ and $h\mu$, respectively, as this seems to help training (see [Montavon et al]).

StandardizedRBM

Train and sample a standardized Restricted Boltzmann machine in Julia. This is a generalization of the [Melchior et al, Montavon et al] centered RBMs. The energy is given by:

$$E(\mathbf{v},\mathbf{h}) = - \sum{i}\theta{i}v{i} - \sum{\mu}\theta{\mu}h{\mu} - \sum{i\mu}w{i\mu} \frac{v{i} - \lambda{i}}{\sigma{i}}\frac{h{\mu} - \lambda{\mu}}{\sigma{\mu}}$$

with some offset parameters $\lambdai,\lambda\mu$ and scaling parameters $\sigmai,\sigma\mu$. Usually $\lambdai,\lambda\mu$ track the mean activities of visible and hidden units, while $\sigmai,\sigma\mu$ track their standard deviations.

Related packages

Adversarially constrained RBMs:

  • https://github.com/cossio/AdvRBMs.jl

Stacked tempering:

  • https://github.com/2024stacktemperingrbm/StackedTempering.jl

References

  • Montavon, Grégoire, and Klaus-Robert Müller. "Deep Boltzmann machines and the centering trick." Neural networks: tricks of the trade. Springer, Berlin, Heidelberg, 2012. 621-637.
  • Melchior, Jan, Asja Fischer, and Laurenz Wiskott. "How to center deep Boltzmann machines." The Journal of Machine Learning Research 17.1 (2016): 3387-3447.

Citation

If you use this package in a publication, please cite:

  • Jorge Fernandez-de-Cossio-Diaz, Simona Cocco, and Remi Monasson. "Disentangling representations in Restricted Boltzmann Machines without adversaries." Physical Review X 13, 021003 (2023).

Or you can use the included CITATION.bib.

Owner

  • Name: Jorge Fernandez-de-Cossio-Diaz
  • Login: cossio
  • Kind: user

Citation (CITATION.bib)

@article{PhysRevX.13.021003,
  title = {Disentangling Representations in Restricted Boltzmann Machines without Adversaries},
  author = {Fernandez-de-Cossio-Diaz, Jorge and Cocco, Simona and Monasson, R\'emi},
  journal = {Phys. Rev. X},
  volume = {13},
  issue = {2},
  pages = {021003},
  numpages = {24},
  year = {2023},
  month = {Apr},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevX.13.021003},
  url = {https://link.aps.org/doi/10.1103/PhysRevX.13.021003}
}

GitHub Events

Total
  • Create event: 6
  • Commit comment event: 13
  • Issues event: 1
  • Release event: 10
  • Watch event: 6
  • Delete event: 3
  • Issue comment event: 12
  • Push event: 1
  • Pull request event: 5
  • Fork event: 2
Last Year
  • Create event: 6
  • Commit comment event: 13
  • Issues event: 1
  • Release event: 10
  • Watch event: 6
  • Delete event: 3
  • Issue comment event: 12
  • Push event: 1
  • Pull request event: 5
  • Fork event: 2

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 1,013
  • Total Committers: 5
  • Avg Commits per committer: 202.6
  • Development Distribution Score (DDS): 0.184
Past Year
  • Commits: 30
  • Committers: 3
  • Avg Commits per committer: 10.0
  • Development Distribution Score (DDS): 0.4
Top Committers
Name Email Commits
cossio j****z@g****m 827
Jorge Fernandez-de-Cossio-Diaz c****o 154
Jorge FdCD j****d@i****m 18
dependabot[bot] 4****] 12
CompatHelper Julia c****y@j****g 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 19
  • Total pull requests: 42
  • Average time to close issues: 5 months
  • Average time to close pull requests: 13 days
  • Total issue authors: 4
  • Total pull request authors: 3
  • Average comments per issue: 6.68
  • Average comments per pull request: 0.48
  • Merged pull requests: 24
  • Bot issues: 0
  • Bot pull requests: 36
Past Year
  • Issues: 1
  • Pull requests: 8
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 month
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.25
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 8
Top Authors
Issue Authors
  • cossio (12)
  • bhomass (3)
  • jquetzalcoatl (1)
  • dependabot[bot] (1)
  • JuliaTagBot (1)
Pull Request Authors
  • dependabot[bot] (47)
  • cossio (6)
  • github-actions[bot] (3)
Top Labels
Issue Labels
dependencies (1)
Pull Request Labels
dependencies (47) github_actions (1)

Packages

  • Total packages: 1
  • Total downloads:
    • julia 6 total
  • Total dependent packages: 8
  • Total dependent repositories: 0
  • Total versions: 138
juliahub.com: RestrictedBoltzmannMachines

Train and sample Restricted Boltzmann machines in Julia

  • Versions: 138
  • Dependent Packages: 8
  • Dependent Repositories: 0
  • Downloads: 6 Total
Rankings
Dependent repos count: 9.9%
Dependent packages count: 11.0%
Average: 24.2%
Stargazers count: 35.6%
Forks count: 40.4%
Last synced: 6 months ago

Dependencies

.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • codecov/codecov-action v2 composite
  • julia-actions/cache v1 composite
  • julia-actions/julia-buildpkg latest composite
  • julia-actions/julia-processcoverage v1 composite
  • julia-actions/julia-runtest latest composite
  • julia-actions/setup-julia v1 composite
.github/workflows/docs.yml actions
  • actions/checkout v2 composite
  • julia-actions/setup-julia latest composite
.github/workflows/TagBot.yml actions
  • JuliaRegistries/TagBot v1 composite
.github/workflows/archive (deactivated)/downgrade.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • julia-actions/cache d10a6fd8f31b12404a54613ebad242900567f2b9 composite
  • julia-actions/julia-buildpkg e3eb439fad4f9aba7da2667e7510e4a46ebc46e1 composite
  • julia-actions/julia-downgrade-compat a14e4360fde479696aacfa6f2b6b8ff538cd6c0f composite
  • julia-actions/julia-runtest 678da69444cd5f13d7e674a90cb4f534639a14f9 composite
  • julia-actions/setup-julia 5c9647d97b78a5debe5164e9eec09d653d29bd71 composite