Update sampler_explaination.md

This commit is contained in:
Extraltodeus
2025-04-27 04:13:10 +02:00
committed by GitHub
parent ff0e08290f
commit a9b7f094a2
+2
View File
@@ -2,6 +2,8 @@
(made using Gemini (and read by myself so you don't just hurt yourself reading potential garbage) and re-touched a little so it's readable)
(I recommand to have the code on the side to follow)
The function _matrix\_batch\_slerp_ implements batched spherical linear interpolation (SLERP). SLERP is a technique used to interpolate between two points on a unit sphere along the great circle that connects them, maintaining a constant angular velocity. This is particularly useful for interpolating rotations or, more generally, directions in high-dimensional spaces. The function is decorated with @torch.no\_grad(), indicating that the operations within it should not be tracked for gradient computation, as it is likely used during inference or sampling. The function takes three arguments: t, which likely represents the original batch of tensors; tn, which is likely the normalized version of t; and w, which probably contains the weights or interpolation factors for each tensor in the batch.
The first step inside matrix\_batch\_slerp is the calculation of dot products between all pairs of normalized tensors in tn: