infergo: Index | Files

package model

import ""

Package model specifies the interface of a probabilistc model.


Package Files


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 {
    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 6 packages. Updated 2021-01-27. Refresh now. Tools for package owners.