model

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 1 Imported by: 2

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 added in v0.7.0

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 added in v0.7.0

func Gradient(m Model) []float64

Gradient automatically selects either supplied or automatic gradient.

func Shift added in v0.3.0

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

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

Types

type ElementalModel added in v0.7.0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL