sample

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sample

func Sample(floats []float64, samplers ...Sampler) ([]float64, error)

Types

type MinP

type MinP float32

func (MinP) Sample

func (s MinP) Sample(t []float64) ([]float64, error)

type Sampler

type Sampler interface {
	Sample([]float64) ([]float64, error)
}

func Greedy

func Greedy() Sampler

func Softmax

func Softmax() Sampler

func Weighed

func Weighed() Sampler

type Temperature

type Temperature float64

func (Temperature) Sample

func (s Temperature) Sample(t []float64) ([]float64, error)

type TopK

type TopK int

func (TopK) Sample

func (s TopK) Sample(t []float64) ([]float64, error)

type TopP

type TopP float32

func (TopP) Sample

func (s TopP) Sample(t []float64) ([]float64, error)

Jump to

Keyboard shortcuts

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