A Python implementation of Deep Belief Networks built upon NumPy and TensorFlow with scikit-learn compatibility.
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| Name | Rank | Metrics |
|---|
| mindsdb/lightwood | 18,071 | - Language:
- Python
- Stars:
- 511
- Forks:
- 101
- Description:
- Lightwood is Legos for Machine Learning.
|
|---|
| thunlp/TensorFlow-TransX | 18,074 | - Language:
- Python
- Stars:
- 511
- Forks:
- 193
- Description:
- An implementation of TransE and its extended models for Knowledge Representation Learning on TensorFlow.
|
|---|
| twtygqyy/pytorch-SRResNet | 18,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_challenge | 18,083 | - Language:
- Python
- Stars:
- 510
- Forks:
- 129
- Description:
- A challenge to explore adversarial robustness of neural networks on CIFAR10.
|
|---|
| microsoft/robustlearn | 18,097 | - Language:
- Python
- Stars:
- 510
- Forks:
- 66
- Description:
- Robust machine learning for responsible AI.
|
|---|
| wvangansbeke/Sparse-Depth-Completion | 18,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_geometric | 18,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-Tasks | 18,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| Parameter | Value |
|---|
| Language | Python |
|---|
| Category | Model Development |
|---|
| Subcategory | Architecture |
|---|
| Keywords | Data science, Model architecture, Research |
|---|
| Stars | 510 |
|---|
| Forks | 208 |
|---|
| Contributors | 6 |
|---|
| Created date | 2015-07-13 |
|---|
| Updated date | 2026-05-23 |
|---|
| Stars in 1 day | 0 |
|---|
| Stars in 7 days | 0 |
|---|
| Rank | 18,089 |
|---|
| Previous rank | 17,850 |
|---|
| Rank change | -239 |
|---|
| 7-day stars rank | 16,458 |
|---|
| Previous 7-day stars rank | 16,471 |
|---|
| 7-day stars rank change | 13 |
|---|
| Total stars rank | 19,072 |
|---|
| Previous total stars rank | 19,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.
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}}