pybambi.neuralnetworks package

Submodules

pybambi.neuralnetworks.base module

Base predictor class.

Author: Will Handley (wh260@cam.ac.uk) Date: November 2018

class pybambi.neuralnetworks.base.Predictor(params, logL, split=0.8)[source]

Bases: object

Base predictor class.

This takes in a training set params -> logL, and aims to construct a mapping between them.

Parameters:
  • paramsnumpy.array of physical parameters to train on shape (ntrain, ndims)
  • logLnumpy.array of loglikelihoods to learn shape (ntrain,)
uncertainty()[source]

Uncertainty value for the trained model.

valid(loglikelihood)[source]

Check validity of proxy.

Checks to see if the supplied log likelihood value is within the current range of likelihoods, including the uncertainty

Parameters:loglikelihood – Value of the log likelihood that needs checking

pybambi.neuralnetworks.kerasnet module

Keras neural net predictor.

This implements a Keras Sequential model (a deep MLP)

Author: Martin White (martin.white@adelaide.edu.au) Date: December 2018

class pybambi.neuralnetworks.kerasnet.KerasNetInterpolation(params, logL, split=0.8, model=None)[source]

Bases: pybambi.neuralnetworks.base.Predictor

Keras neural net interpolation.

Returns the loglikelihood from a Keras neural net-based interpolator

Trains a basic 3-layer neural network with 200 neurons per layer.

Parameters:
  • paramsnumpy.array of physical parameters to train on shape (ntrain, ndims)
  • logLnumpy.array of loglikelihoods to learn shape (ntrain,)
uncertainty()[source]

Uncertainty value for the trained keras model.

pybambi.neuralnetworks.nearestneighbour module

Nearest neighbour interpolation predictor.

Author: Will Handley (wh260@cam.ac.uk) Date: November 2018

This implements a nearest neighbour interpolation, and is designed as a placeholder predictor, rather than an actual neural network

class pybambi.neuralnetworks.nearestneighbour.NearestNeighbourInterpolation(params, logL, split=0.8)[source]

Bases: pybambi.neuralnetworks.base.Predictor

Nearest Neighbour interpolation.

Returns the loglikelihood of the training point closest in parameter space

Parameters:
  • paramsnumpy.array of physical parameters to train on shape (ntrain, ndims)
  • logLnumpy.array of loglikelihoods to learn shape (ntrain,)
uncertainty()[source]

Rough uncertainty for the nearest neighbour model.

Module contents

Collection of neural network interpolators.

Author: Will Handley (wh260@cam.ac.uk) Date: November 2018