infergo: bitbucket.org/dtolpin/infergo/model Index | Files

package model

import "bitbucket.org/dtolpin/infergo/model"

Package model specifies the interface of a probabilistc model.

Index

Package Files

model.go

func DropGradient Uses

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 Uses

func Gradient(m Model) []float64

Gradient automatically selects either supplied or automatic gradient.

func Shift Uses

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

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

type ElementalModel Uses

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

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

type Model Uses

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.

Package model imports 1 packages (graph) and is imported by 1 packages. Updated 2019-10-05. Refresh now. Tools for package owners.