Documentation
¶
Index ¶
- Variables
- func EucDistance(x, y *G.Node) (retVal *G.Node)
- func FillTensorRows(batchSize int, inputs tensor.Tensor) (x tensor.Tensor, err error)
- func InitForwardOnlyVm(uProfileDim, uBehaviorSize, uBehaviorDim, iFeatureDim, cFeatureDim int, ...) (err error)
- func PRelu(x, slop *G.Node) (retVal *G.Node)
- func Predict(m Model, numExamples, batchSize int, si *rcmd.SampleInfo, inputs tensor.Tensor) (y []float32, err error)
- func Train(uProfileDim, uBehaviorSize, uBehaviorDim, iFeatureDim, cFeatureDim int, ...) (err error)
- type DinNet
- func (din *DinNet) Fwd(xUserProfile, xUbMatrix, xItemFeature, xCtxFeature *G.Node, ...) (err error)
- func (din *DinNet) Graph() *G.ExprGraph
- func (din *DinNet) In() G.Nodes
- func (din *DinNet) Marshal() (data []byte, err error)
- func (din *DinNet) Out() *G.Node
- func (din *DinNet) SetVM(vm G.VM)
- func (din *DinNet) Vm() G.VM
- type Model
- type SimpleMLP
- func (mlp *SimpleMLP) Fwd(xUserProfile, ubMatrix, xItemFeature, xCtxFeature *G.Node, ...) (err error)
- func (mlp *SimpleMLP) Graph() *G.ExprGraph
- func (mlp *SimpleMLP) In() G.Nodes
- func (mlp *SimpleMLP) Marshal() (data []byte, err error)
- func (mlp *SimpleMLP) Out() *G.Node
- func (mlp *SimpleMLP) SetVM(vm G.VM)
- func (mlp *SimpleMLP) Vm() G.VM
Constants ¶
This section is empty.
Variables ¶
var DT = tensor.Float32
Functions ¶
func EucDistance ¶
EucDistance is the Euclidean distance between two matrix, typically used for calculating the distance between two embedding. Case1: x, y shapes are same, no broadcast. output shape will be x.shape[:-1] Case2: x, y shapes are different, broadcast will be applied on the smaller dim. output shape will be something like x.shape[:-1] but with a broadcast dim
func FillTensorRows ¶ added in v0.3.0
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 ¶
Types ¶
type DinNet ¶
type DinNet struct {
// contains filtered or unexported fields
}
func NewDinNetFromJson ¶
func (*DinNet) Fwd ¶
func (din *DinNet) Fwd(xUserProfile, xUbMatrix, xItemFeature, xCtxFeature *G.Node, batchSize, uBehaviorSize, uBehaviorDim int) (err error)
Fwd performs the forward pass xUserProfile: [batchSize, userProfileDim] xUbMatrix: [batchSize, uBehaviorSize* uBehaviorDim] xUserBehaviors: [batchSize, uBehaviorSize, uBehaviorDim] xItemFeature: [batchSize, iFeatureDim] xContextFeature: [batchSize, cFeatureDim]
type SimpleMLP ¶
type SimpleMLP struct {
// contains filtered or unexported fields
}