model

package
Version: v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2021 License: MIT Imports: 1 Imported by: 3

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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL