StochANNPy (STOCHAstic Artificial Neural Network for PYthon) provides user-friendly routines compatible with Scikit-Learn for stochastic learning.
|Copyright:||This document has been placed in the public domain.|
|License:||StochANNPy is released under the MIT License.|
NOTE: StochANNPy has been implemented in the frame of my Ph. D. thesis. If you find any error or bug, or if you have any suggestion, please don’t hesitate to contact me.
StochANNPy provides routines compatible with Scikit-Learn for stochastic learning including:
- Bayesian neural networks (currently, only classifier) 
- Evolutionary neural networks (currently, only classifier)
- Monte-Carlo Cross-Validation (currently, only classifier)
NOTE: ENNClassifier, BNNClassifier, MCCVClassifier all passed Scikit-Learn checks test! …well almost. Bayesian learning requires more than 5 samples to explore the weight space, BNNClassifier only pass when increasing the maximum number of iterations (line 280 of the script).
The recommended way to install StochANNPy is through pip:
pip install stochannpy
Otherwise, download and extract the package, then run:
python setup.py install
First, import StochANNPy and initialize the classifier:
import numpy as np from stochannpy import BNNClassifier clf = BNNClassifier(hidden_layer_sizes = (5,))
Fit the training set:
Predict the test set:
ypred = clf.predict(X_test)
Compute the accuracy:
print(np.mean(ypred == y_test))
|||N. Radford, Bayesian Learning for Neural Networks, Lecture Notes in Statistics, Springer, 1996|