Uses of Enum Class
ai.beestream.jitnn.F.Reduction
Packages that use F.Reduction
Package
Description
The jitNN API:
Tensor (n-dimensional arrays, lazy on TornadoVM
devices), reverse-mode differentiation (Tensor.backward(), Grad),
the functional operators of F, linear algebra (Linalg),
Fourier transforms (Fft), sparse matrices (SparseMatrix),
mixed precision (Autocast) and user-defined operators
(CustomOp).-
Uses of F.Reduction in ai.beestream.jitnn
Subclasses with type arguments of type F.Reduction in ai.beestream.jitnnModifier and TypeClassDescriptionstatic enumHow a loss reduces its per-element values.Methods in ai.beestream.jitnn that return F.ReductionModifier and TypeMethodDescriptionstatic F.ReductionReturns the enum constant of this class with the specified name.static F.Reduction[]F.Reduction.values()Returns an array containing the constants of this enum class, in the order they are declared.Methods in ai.beestream.jitnn with parameters of type F.ReductionModifier and TypeMethodDescriptionstatic TensorF.binaryCrossEntropy(Tensor p, Tensor target, F.Reduction reduction) F.binaryCrossEntropy(Tensor, Tensor)reduced asreductionsays.static TensorF.binaryCrossEntropyWithLogits(Tensor logits, Tensor target, F.Reduction reduction) F.binaryCrossEntropyWithLogits(Tensor, Tensor)reduced asreductionsays.static TensorF.contrastiveLoss(Tensor a, Tensor b, Tensor similar, float margin, F.Reduction reduction) Contrastive loss (Hadsell et al., 2006) withsimilar1 for similar pairs and 0 for dissimilar ones: similar d^2 + (1 - similar) max(margin - d, 0)^2.static TensorF.cosineEmbeddingLoss(Tensor a, Tensor b, Tensor target, float margin, F.Reduction reduction) Cosine embedding loss: 1 - cos(a, b) for target 1, max(0, cos(a, b) - margin) for -1.static TensorF.cosineProximityLoss(Tensor input, Tensor target, F.Reduction reduction) Cosine proximity loss (DL4J, Keras): minus the cosine similarity along the last axis, reduced.static TensorF.ctcLoss(Tensor logProbs, Tensor targets, int[] inputLengths, int[] targetLengths, int blank, F.Reduction reduction) CTC loss, PyTorch's ctc_loss: log-probabilities [T, B, C] (log_softmax over C), INT32 targets [B, L] padded, input and target lengths; blank indexblank.static TensorF.hingeLoss(Tensor input, Tensor target, F.Reduction reduction) Hinge loss with targets in {-1, 1}: max(0, 1 - target * input), Keras's hinge (mean).static TensorF.huberLoss(Tensor input, Tensor target, float delta, F.Reduction reduction) Huber loss with thresholddelta: 0.5 d^2 where |d| < delta, else delta (|d| - delta / 2), d = input - target (PyTorch's huber_loss).static TensorF.l1Loss(Tensor input, Tensor target, F.Reduction reduction) Mean absolute error (L1), PyTorch's l1_loss.static TensorF.mapeLoss(Tensor input, Tensor target, F.Reduction reduction) Mean absolute percentage error: 100 |target - input| / max(|target|, eps) (Keras's MAPE, eps 1e-7).static TensorF.marginRankingLoss(Tensor x1, Tensor x2, Tensor target, float margin, F.Reduction reduction) Margin ranking loss: max(0, -target (x1 - x2) + margin), target 1 or -1.static TensorF.mseLoss(Tensor input, Tensor target, F.Reduction reduction) Squared error betweeninputandtarget(same shape), reduced asreductionsays.static TensorF.msleLoss(Tensor input, Tensor target, F.Reduction reduction) Mean squared logarithmic error: (log1p(input) - log1p(target))^2 (Keras's MSLE).static TensorF.nllLoss(Tensor logp, Tensor labels, F.Reduction reduction) Negative log-likelihood of INT32 labels under log-probabilities [N, C], reduced.static TensorF.poissonNllLoss(Tensor input, Tensor target, boolean logInput, float eps, F.Reduction reduction) Poisson negative log-likelihood, PyTorch's poisson_nll_loss without the Stirling term: exp(input) - target input withlogInput, else input - target log(input + eps).static TensorF.smoothL1Loss(Tensor input, Tensor target, float beta, F.Reduction reduction) Smooth L1 loss, PyTorch's smooth_l1_loss: Huber with delta = beta, divided by beta.static TensorF.squaredHingeLoss(Tensor input, Tensor target, F.Reduction reduction) Squared hinge loss: max(0, 1 - target * input)^2.static TensorF.tripletMarginLoss(Tensor anchor, Tensor positive, Tensor negative, float margin, F.Reduction reduction) Triplet margin loss: max(d(anchor, positive) - d(anchor, negative) + margin, 0).