Documentation ¶
Index ¶
- Variables
- func BinaryCrossEntropy32(yPred, yTrue *G.Node) *G.Node
- func CosineSimilarity(x, y *G.Node) (retVal *G.Node, err error)
- func EucDistance(x, y *G.Node) (retVal *G.Node, err error)
- func FillTensorRows(batchSize int, inputs tensor.Tensor) (x tensor.Tensor, err error)
- func InitForwardOnlyVm(uProfileDim, uBehaviorSize, uBehaviorDim, iFeatureDim, cFeatureDim int, ...) (err error)
- func MSE32(yPred, yTrue *G.Node) *G.Node
- func PRelu32(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 RMS32(yPred, yTrue *G.Node) *G.Node
- func Train(uProfileDim, uBehaviorSize, uBehaviorDim, iFeatureDim, cFeatureDim int, ...) (err error)
- type Model
Constants ¶
This section is empty.
Variables ¶
var DT = tensor.Float32
Functions ¶
func BinaryCrossEntropy32 ¶ added in v0.5.0
BinaryCrossEntropy32 calculates the binary cross entropy cost loss formula: -y_true * log(y_pred) - (1 - y_true) * log(1 - y_pred)
func CosineSimilarity ¶ added in v0.5.0
CosineSimilarity is the cosine 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 EucDistance ¶ added in v0.5.0
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 ¶
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 PRelu32 ¶ added in v0.5.0
PRelu32 is the slop learnable LeakyRelu activation function slop should be a scalar