Documentation

Overview

    Package model specifies the interface of a probabilistc model.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    func DropGradient

    func DropGradient(m Model)

      DropGradient can be called instead of Gradient when the gradient is not required. For automaticall differentated models DropGradient will pop the frame from the tape; for elemental models it will do nothing.

      func Gradient

      func Gradient(m Model) []float64

        Gradient automatically selects either supplied or automatic gradient.

        func Shift

        func Shift(px *[]float64, n int) []float64

          Shift shifts n parameters from x, useful for destructuring the parameter vector.

          Types

          type ElementalModel

          type ElementalModel interface {
          	Model
          	Gradient() []float64
          }

            An elemental model uses a supplied gradient instead of automatic differentation.

            type Model

            type Model interface {
            	Observe(parameters []float64) float64
            }

              A probabilistic model must implement interface Model. Method Observe accepts a vector of parameters and returns the loglikelihood. Computation of the gradient is automatically induced through algorithmic differentiation.

              Source Files