glove

package
v0.0.0-...-ba2758a Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdaGrad

type AdaGrad struct {
	// contains filtered or unexported fields
}

AdaGrad behaviors as one of Glove solver.

func NewAdaGrad

func NewAdaGrad(dimension int, initlr float64) *AdaGrad

NewAdaGrad creates *AdaGrad.

type Glove

type Glove struct {
	*model.Option
	*GloveOption
	*corpus.CountModelCorpus
	// contains filtered or unexported fields
}

Glove stores the configs for Glove models.

func NewGlove

func NewGlove(option *model.Option, gloveOption *GloveOption) *Glove

NewGlove creates *Glove.

func (*Glove) Get

func (g *Glove) Get() (map[string][]float64, error)

func (*Glove) Save

func (g *Glove) Save(outputPath string) error

Save saves the word vector to outputFile.

func (*Glove) Train

func (g *Glove) Train(f io.Reader) error

Train trains words' vector on corpus.

type GloveOption

type GloveOption struct {
	Solver Solver
	Xmax   int
	Alpha  float64
}

type Sgd

type Sgd struct {
	// contains filtered or unexported fields
}

Sgd is stochastic gradient descent that behaviors as one of GloVe solver.

func NewSgd

func NewSgd(dimension int, initlr float64) *Sgd

NewSgd creates *Sgd.

type Solver

type Solver interface {
	// contains filtered or unexported methods
}

Solver is the interface for training with GloVe.

type SolverType

type SolverType int
const (
	SGD SolverType = iota
	ADAGRAD
)

func (SolverType) String

func (t SolverType) String() string

Jump to

Keyboard shortcuts

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