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 ¶
- func LoadForCmd(cmd *cobra.Command, opts *Options)
- func New(opts ...ModelOption) (model.Model, error)
- func NewForOptions(opts Options) (model.Model, error)
- type ModelOption
- func Alpha(v float64) ModelOption
- func BatchSize(v int) ModelOption
- func Dim(v int) ModelOption
- func DocInMemory() ModelOption
- func Goroutines(v int) ModelOption
- func Initlr(v float64) ModelOption
- func Iter(v int) ModelOption
- func MaxCount(v int) ModelOption
- func MinCount(v int) ModelOption
- func Solver(typ SolverType) ModelOption
- func SubsampleThreshold(v float64) ModelOption
- func ToLower() ModelOption
- func Verbose() ModelOption
- func Window(v int) ModelOption
- func Xmax(v int) ModelOption
- type Options
- type SolverType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadForCmd ¶
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" )
Click to show internal directories.
Click to hide internal directories.