maxspn

package module
v0.0.0-...-a3ccc57 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2017 License: GPL-3.0 Imports: 10 Imported by: 0

README

maxspn

Algorithms and data in the paper:

Jun Mei, Yong Jiang and Kewei Tu, "Maximum A Posteriori Inference in Sum-Product Networks". In the Thirty-Second AAAI Conference on Artificial Intelligence (AAAI 2018), New Orleans, Lousiana, USA, February 2–7, 2018.

See documents on GoDoc.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApproxBS

func ApproxBS(spn SPN, beamSize int, timeout int) float64

func ApproxBT

func ApproxBT(spn SPN) []int

func ApproxKBT

func ApproxKBT(spn SPN, k int, timeout int) float64

func ApproxNG

func ApproxNG(spn SPN) []int

func ExactFC

func ExactFC(spn SPN, baseline float64, timeout int) float64

Exact solver with Forwarding Checking

func ExactFCnO

func ExactFCnO(spn SPN, baseline float64, timeout int) float64

Exact solver with Forward Checking + Ordering

func ExactFCnOnS

func ExactFCnOnS(spn SPN, baseline float64, timeout int) float64

Exact solver with Forward Checking + Ordering + Stage

func ExactMC

func ExactMC(spn SPN, baseline float64, timeout int) float64

Exact solver with Marginal Checking

func X2Ass

func X2Ass(x []int, schema []int) [][]float64

Types

type Node

type Node interface {
	ID() int
	SetID(id int)
}

type Prd

type Prd struct {
	Edges []PrdEdge
	// contains filtered or unexported fields
}

func (*Prd) ID

func (p *Prd) ID() int

func (*Prd) SetID

func (p *Prd) SetID(id int)

type PrdEdge

type PrdEdge struct {
	Node Node
}

type SPN

type SPN struct {
	Nodes  []Node
	Schema []int
}

func LoadSPN

func LoadSPN(filename string) SPN

func MAP2MAX

func MAP2MAX(spn SPN, q []byte) SPN

func (SPN) Derivative

func (spn SPN) Derivative(ass [][]float64) []float64

func (SPN) DerivativeX

func (spn SPN) DerivativeX(x []int) []float64

func (SPN) Eval

func (spn SPN) Eval(ass [][]float64) []float64

func (SPN) EvalX

func (spn SPN) EvalX(x []int) float64

type Sum

type Sum struct {
	Edges []SumEdge
	// contains filtered or unexported fields
}

func (*Sum) ID

func (s *Sum) ID() int

func (*Sum) SetID

func (s *Sum) SetID(id int)

type SumEdge

type SumEdge struct {
	Weight float64 // in log domain
	Node   Node
}

type Trm

type Trm struct {
	Kth   int // k-th variable
	Value int // variable state
	// contains filtered or unexported fields
}

func (*Trm) ID

func (t *Trm) ID() int

func (*Trm) SetID

func (t *Trm) SetID(id int)

type XP

type XP struct {
	X []int
	P float64
}

func ApproxAMAP

func ApproxAMAP(spn SPN, timeout int) XP

Jump to

Keyboard shortcuts

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