model

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func FillTensorRows

func FillTensorRows(batchSize int, inputs tensor.Tensor) (x tensor.Tensor, err error)

FillTensorRows fills the batch samples with the zero data to make sample size fit the batch size it sames tensor.Concat is not optimized for large dataset. we should avoid using FillTensorRows while input data is large.

func InitForwardOnlyVm

func InitForwardOnlyVm(uProfileDim, uBehaviorSize, uBehaviorDim, iFeatureDim, cFeatureDim int,
	batchSize int,
	m Model,
) (err error)

func Predict

func Predict(m Model, numExamples, batchSize int, si *rcmd.SampleInfo, inputs tensor.Tensor) (y []float32, err error)

func Train

func Train(uProfileDim, uBehaviorSize, uBehaviorDim, iFeatureDim, cFeatureDim int,
	numExamples, batchSize, epochs, earlyStop int,
	si *rcmd.SampleInfo,
	inputs, targets tensor.Tensor,

	m Model,
) (err error)

Types

type Model

type Model interface {
	Learnable() G.Nodes
	Fwd(xUserProfile, ubMatrix, xItemFeature, xCtxFeature *G.Node, batchSize, uBehaviorSize, uBehaviorDim int) (err error)
	Out() *G.Node
	In() G.Nodes
	Graph() *G.ExprGraph
	Marshal() (data []byte, err error)
	Vm() G.VM
	SetVM(vm G.VM)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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