glove

package
v0.0.0-...-bce0611 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: Apache-2.0 Imports: 22 Imported by: 1

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 Alpha

func Alpha(v float64) ModelOption

func BatchSize

func BatchSize(v int) ModelOption

func Dim

func Dim(v int) ModelOption

func DocInMemory

func DocInMemory() ModelOption

func Goroutines

func Goroutines(v int) ModelOption

func Initlr

func Initlr(v float64) ModelOption

func Iter

func Iter(v int) ModelOption

func MaxCount

func MaxCount(v int) ModelOption

func MinCount

func MinCount(v int) ModelOption

func Solver

func Solver(typ SolverType) ModelOption

func SubsampleThreshold

func SubsampleThreshold(v float64) ModelOption

func ToLower

func ToLower() ModelOption

func Verbose

func Verbose() ModelOption

func Window

func Window(v int) ModelOption

func Xmax

func Xmax(v int) ModelOption

type Options

type Options struct {
	Alpha              float64
	BatchSize          int
	CountType          co.CountType
	Dim                int
	DocInMemory        bool
	Goroutines         int
	Initlr             float64
	Iter               int
	LogBatch           int
	MaxCount           int
	MinCount           int
	SolverType         SolverType
	SubsampleThreshold float64
	ToLower            bool
	Verbose            bool
	Window             int
	Xmax               int
}

func DefaultOptions

func DefaultOptions() Options

type SolverType

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

Jump to

Keyboard shortcuts

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