pmlearn.neural_network package

Submodules

pmlearn.neural_network.multilayer_perceptron module

Multilayer perceptron

class pmlearn.neural_network.multilayer_perceptron.MLPClassifier(n_hidden=5)[source]

Bases: pmlearn.base.BayesianModel, pmlearn.base.BayesianClassifierMixin

Multilayer perceptron classification built using PyMC3.

Fit a Multilayer perceptron classification model and estimate model parameters using MCMC algorithms or Variational Inference algorithms

Examples

http://twiecki.github.io/blog/2016/06/01/bayesian-deep-learning/

create_model()[source]
load(file_prefix)[source]

Loads a saved version of the trace, and custom param files with the given file_prefix.

Parameters:
  • file_prefix (str, path and prefix used to identify where to load the) –
  • trace for this model. (saved) – Ex: given file_prefix = “path/to/file/” This will attempt to load “path/to/file/trace.pickle”
  • load_custom_params (Boolean flag to indicate whether custom parameters) –
  • be loaded. Defaults to False. (should) –
Returns:

custom_params

Return type:

Dictionary of custom parameters

save(file_prefix)[source]

Saves the trace and custom params to files with the given file_prefix.

Parameters:
  • file_prefix (str, path and prefix used to identify where to save the) –
  • for this model. (trace) – Ex: given file_prefix = “path/to/file/” This will attempt to save to “path/to/file/trace.pickle”
  • custom_params (Dictionary of custom parameters to save.) – Defaults to None

Module contents

The pmlearn.neural_network module includes models based on neural networks.

class pmlearn.neural_network.MLPClassifier(n_hidden=5)[source]

Bases: pmlearn.base.BayesianModel, pmlearn.base.BayesianClassifierMixin

Multilayer perceptron classification built using PyMC3.

Fit a Multilayer perceptron classification model and estimate model parameters using MCMC algorithms or Variational Inference algorithms

Examples

http://twiecki.github.io/blog/2016/06/01/bayesian-deep-learning/

create_model()[source]
load(file_prefix)[source]

Loads a saved version of the trace, and custom param files with the given file_prefix.

Parameters:
  • file_prefix (str, path and prefix used to identify where to load the) –
  • trace for this model. (saved) – Ex: given file_prefix = “path/to/file/” This will attempt to load “path/to/file/trace.pickle”
  • load_custom_params (Boolean flag to indicate whether custom parameters) –
  • be loaded. Defaults to False. (should) –
Returns:

custom_params

Return type:

Dictionary of custom parameters

save(file_prefix)[source]

Saves the trace and custom params to files with the given file_prefix.

Parameters:
  • file_prefix (str, path and prefix used to identify where to save the) –
  • for this model. (trace) – Ex: given file_prefix = “path/to/file/” This will attempt to save to “path/to/file/trace.pickle”
  • custom_params (Dictionary of custom parameters to save.) – Defaults to None