xnn.krnn.models.sgdml.kernel_energy#
- xnn.krnn.models.sgdml.kernel_energy(x, xp, wp, ec, kernel, gradient=False)[source]#
sum_{j,q} g(r) (D.w) + k(r) a_jfor descriptorsx(B, D)(paper eq. 5).xpandwpare the(M, Q, D)permuted training descriptors and weights,ecthe(M,)energy coefficients (possibly empty). Withgradientthe(B, D)gradient (kernel_energy_gradient()) is formed in the same pass over the differences and returned as well.