← Open Source
albertbup

deep-belief-network

A Python implementation of Deep Belief Networks built upon NumPy and TensorFlow with scikit-learn compatibility.

Model DevelopmentArchitecturePython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
510
Stars
208
Forks
+0
This week
6
Contributors
Created 2015-07-13 · Updated 2026-05-23 · #18089 today
Top developers
albertbupmathiasvhskx300

albertbup/deep-belief-network is ranked 18,089 with 510 stars.

Same-category comparison

albertbup/deep-belief-network is ranked 18,089 among these 8 peers; MadryLab/cifar10_challenge is ranked 18,083.

Same-category comparison
NameRankMetrics
mindsdb/lightwood18,071
Language:
Python
Stars:
511
Forks:
101
Description:
Lightwood is Legos for Machine Learning.
thunlp/TensorFlow-TransX18,074
Language:
Python
Stars:
511
Forks:
193
Description:
An implementation of TransE and its extended models for Knowledge Representation Learning on TensorFlow.
twtygqyy/pytorch-SRResNet18,077
Language:
Python
Stars:
511
Forks:
130
Description:
pytorch implementation for Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network arXiv:1609.04802.
MadryLab/cifar10_challenge18,083
Language:
Python
Stars:
510
Forks:
129
Description:
A challenge to explore adversarial robustness of neural networks on CIFAR10.
microsoft/robustlearn18,097
Language:
Python
Stars:
510
Forks:
66
Description:
Robust machine learning for responsible AI.
wvangansbeke/Sparse-Depth-Completion18,102
Language:
Python
Stars:
510
Forks:
77
Description:
Predict dense depth maps from sparse and noisy LiDAR frames guided by RGB images. (Ranked 1st place on KITTI) [MVA 2019].
CrawlScript/tf_geometric18,104
Language:
Python
Stars:
509
Forks:
94
Description:
Efficient and Friendly Graph Neural Network Library for TensorFlow 1.x and 2.x.
NousResearch/Open-Reasoning-Tasks18,107
Language:
JavaScript
Stars:
509
Forks:
72
Description:
A comprehensive repository of reasoning tasks for LLMs (and beyond).
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryModel Development
SubcategoryArchitecture
KeywordsData science, Model architecture, Research
Stars510
Forks208
Contributors6
Created date2015-07-13
Updated date2026-05-23
Stars in 1 day0
Stars in 7 days0
Rank18,089
Previous rank17,850
Rank change-239
7-day stars rank16,458
Previous 7-day stars rank16,471
7-day stars rank change13
Total stars rank19,072
Previous total stars rank19,047
Total stars rank change-25
README summary

deep-belief-network A simple, clean, fast Python implementation of Deep Belief Networks based on binary Restricted Boltzmann Machines (RBM), built upon NumPy, TensorFlow and scikit-learn: Hinton, Geoffrey E. "A fast learning algorithm for deep belief nets. "Training restricted Boltzmann machines: an introduction. Overview This project works on Python 3. 6 and follows the scikit-learn API guidelines. The code includes two implementations: one is built on top of TensorFlow while the other one just uses NumPy. To decide

which one to use is as easy as importing the classes from the correct module: for TensorFlow or for NumPy. Usage Clone this repository: and go to the root folder: The docker way: Build the docker image (you'll need to have docker installed in your system): Cool, let's go inside the container and run an example: The virtualenv way: Create a virtual environment for **Python 3. Next, install requirements: Finally, run an example: Citing the code BibTex reference format:

Frequently asked questions

How many stars and forks are recorded?

albertbup/deep-belief-network has 510 stars and 208 forks.

What is the repository rank?

albertbup/deep-belief-network is ranked 18,089.

What language and category are recorded?

albertbup/deep-belief-network has 510 stars, uses Python and belongs to Model Development.

Which repository is closest in rank?

albertbup/deep-belief-network is compared with MadryLab/cifar10_challenge, ranked 18,083 with 510 stars.

README

deep-belief-network

A simple, clean, fast Python implementation of Deep Belief Networks based on binary Restricted Boltzmann Machines (RBM), built upon NumPy, TensorFlow and scikit-learn:

Hinton, Geoffrey E., Simon Osindero, and Yee-Whye Teh. "A fast learning algorithm for deep belief nets." Neural computation 18.7 (2006): 1527-1554.

Fischer, Asja, and Christian Igel. "Training restricted Boltzmann machines: an introduction." Pattern Recognition 47.1 (2014): 25-39.

Overview

This project works on Python 3.6 and follows the scikit-learn API guidelines. The code includes two implementations: one is built on top of TensorFlow while the other one just uses NumPy. To decide which one to use is as easy as importing the classes from the correct module: dbn.tensorflow for TensorFlow or dbn for NumPy.

import numpy as np

np.random.seed(1337)  # for reproducibility
from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split
from sklearn.metrics.classification import accuracy_score

from dbn.tensorflow import SupervisedDBNClassification
# use "from dbn import SupervisedDBNClassification" for computations on CPU with numpy

# Loading dataset
digits = load_digits()
X, Y = digits.data, digits.target

# Data scaling
X = (X / 16).astype(np.float32)

# Splitting data
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.2, random_state=0)

# Training
classifier = SupervisedDBNClassification(hidden_layers_structure=[256, 256],
                                         learning_rate_rbm=0.05,
                                         learning_rate=0.1,
                                         n_epochs_rbm=10,
                                         n_iter_backprop=100,
                                         batch_size=32,
                                         activation_function='relu',
                                         dropout_p=0.2)
classifier.fit(X_train, Y_train)

# Save the model
classifier.save('model.pkl')

# Restore it
classifier = SupervisedDBNClassification.load('model.pkl')

# Test
Y_pred = classifier.predict(X_test)
print('Done.\nAccuracy: %f' % accuracy_score(Y_test, Y_pred))

Usage

Clone this repository:

git clone https://github.com/albertbup/deep-belief-network.git

and go to the root folder:

cd deep-belief-network

The docker way:

Build the docker image (you'll need to have docker installed in your system):

docker build --tag albertbup/deep-belief-network:1.0.5 .

Cool, let's go inside the container and run an example:

docker run --rm -it -v ${PWD}:/code albertbup/deep-belief-network:1.0.5 bash
# Now within the container...
python example_classification.py

The virtualenv way:

Create a virtual environment for Python 3.6 and activate it.

Next, install requirements:

pip install -r requirements.txt

Finally, run an example:

# Now within the virtual environment...
python example_classification.py

Citing the code

BibTex reference format:

    @misc{DBNAlbert,
    title={A Python implementation of Deep Belief Networks built upon NumPy and TensorFlow with scikit-learn compatibility},
    url={https://github.com/albertbup/deep-belief-network},
    author={albertbup},
    year={2017}}
Nearby in the ranking
Similar items