glove

package
v0.0.0-...-382d658 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Copyright © 2020 wego authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadForCmd

func LoadForCmd(cmd *cobra.Command, opts *Options)

func New

func New(opts ...ModelOption) (model.Model, error)

func NewForOptions

func NewForOptions(opts Options) (model.Model, error)

Types

type ModelOption

type ModelOption func(*Options)

func ToLower

func ToLower() ModelOption

func Verbose

func Verbose() ModelOption

func WithAlpha

func WithAlpha(v float64) ModelOption

for glove options

func WithBatchSize

func WithBatchSize(v int) ModelOption

model options

func WithCountType

func WithCountType(typ pairwise.CountType) ModelOption

pairwise options

func WithDimension

func WithDimension(v int) ModelOption

func WithInitLearningRate

func WithInitLearningRate(v float64) ModelOption

func WithIteration

func WithIteration(v int) ModelOption

func WithMinCount

func WithMinCount(v int) ModelOption

corpus options

func WithSolver

func WithSolver(typ SolverType) ModelOption

func WithSubsampleThreshold

func WithSubsampleThreshold(v float64) ModelOption

func WithThreadSize

func WithThreadSize(v int) ModelOption

func WithWindow

func WithWindow(v int) ModelOption

func WithXmax

func WithXmax(v int) ModelOption

type Options

type Options struct {
	CorpusOptions   corpus.Options
	PairwiseOptions pairwise.Options
	ModelOptions    model.Options

	Alpha              float64
	SolverType         SolverType
	SubsampleThreshold float64
	Xmax               int
}

type SolverType

type SolverType string
const (
	Stochastic SolverType = "sgd"
	AdaGrad    SolverType = "adagrad"
)

func (*SolverType) Set

func (t *SolverType) Set(name string) error

func (*SolverType) String

func (t *SolverType) String() string

func (*SolverType) Type

func (t *SolverType) Type() string

Jump to

Keyboard shortcuts

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