twodlearn.bayesnet.recurrent module

This module defines recurrent bayesian neural-networks

class twodlearn.bayesnet.recurrent.BayesNarx(cell, window_size, name=None, options=None, **kargs)[source]

Bases: twodlearn.recurrent.SimpleRnn

class McRnnOutput(n_particles, x0=None, inputs=None, n_unrollings=None, options=None, name=None, **kargs)[source]

Bases: twodlearn.bayesnet.recurrent.RnnOutput

inputs[source]
property n_particles[source]
x0[source]
class RnnOutput(model, x0=None, inputs=None, n_unrollings=None, options=None, name=None)[source]

Bases: twodlearn.recurrent.RnnOutput

property window_size[source]
x0[source]

list of observations of the initial state. :param value: value for x0 :type value: None, tf.Tensor, McNormal

Returns

x0

Return type

list(McNormal)

mc_evaluate(n_particles, x0=None, inputs=None, n_unrollings=None, options=None, name=None, **kargs)[source]
property window_size[source]
class twodlearn.bayesnet.recurrent.DropoutMlpCell(n_inputs, n_outputs, n_hidden, window_size, keep_prob, options=None, name='DropoutMlpCell')[source]

Bases: twodlearn.bayesnet.recurrent.GaussianMlpCell

property keep_prob[source]
class twodlearn.bayesnet.recurrent.GaussianMlpCell(n_inputs, n_outputs, n_hidden, window_size, options=None, name='GaussianMlpCell')[source]

Bases: twodlearn.core.common.TdlModel

ModelOutput[source]

alias of GaussianMlpCell.Output

class Output(model, state, inputs, t, options=None, name=None)[source]

Bases: twodlearn.core.common.TdlModel

property dz[source]

Output delta increment before applying observation noise

evaluate(xt, ut, t)[source]
model[source]
property u_inputs[source]

Exogenous inputs to the cell

property x[source]

State of the cell, in the case of Narx, is the list of window_size previous observations y

property x_inputs[source]

State inputs to the cell

property y[source]

Observable output of the cell

evaluate(state, inputs, t, options=None, name=None)[source]
mlp[source]
property n_hidden[source]
property n_inputs[source]
property n_outputs[source]
property normalizer[source]
regularizer[source]

Decorator used to specify a regularizer for a model. The decorator works similar to @property, but the specified method correponds to the initialization of the regularizer.

setup(*args, **kargs)[source]
property window_size[source]
class twodlearn.bayesnet.recurrent.NormalNarxCell(fz, fy=None, options=None, name='GaussianMlpCell', **kargs)[source]

Bases: twodlearn.core.common.TdlModel

(state, input) -> normalizer -> finput -> fz -> fy

class NarxConcat(axis, name='Concat')[source]

Bases: twodlearn.feedforward.Concat

class NormalNarxOutput(**kargs)[source]

Bases: twodlearn.core.common.OutputModel

loss[source]

Decorator used to specify an optional property inside a model. The decorator works similar to @property, but the specified method correponds to the initialization of the property

evaluate(*args, **kargs)[source]
finput[source]
fy[source]
fz[source]
normalizer[source]

Decorator used to specify an optional property inside a model. The decorator works similar to @property, but the specified method correponds to the initialization of the property

regularizer[source]

Decorator used to specify a regularizer for a model. The decorator works similar to @property, but the specified method correponds to the initialization of the regularizer.

twodlearn.bayesnet.recurrent.normal_residual_wrapper(model)[source]