Initial release

This commit is contained in:
civ
2026-08-16 18:24:52 +07:00
commit 876886a39a
13244 changed files with 2353959 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
-- apg.lua: Adaptive Perpendicular Guidance (default)
-- Routes through the native C++ apg_forward() for momentum smoothing,
-- per-channel norm thresholding, and perpendicular projection.
-- In practice, the engine takes the native C++ path for APG directly,
-- but this Lua implementation exists as a correct fallback.
guidance = {
name = "apg",
display = "APG",
description = "Adaptive perpendicular guidance (default)",
params = {
{ key = "momentum", type = "slider", label = "Momentum",
default = 0.75, min = -1, max = 1, step = 0.01,
hint = "APG momentum coefficient (negative = adaptive)" },
{ key = "norm_threshold", type = "slider", label = "Norm Threshold",
default = 2.5, min = 0, max = 10, step = 0.1,
hint = "APG norm clipping threshold" },
},
}
function guide(pred_cond, pred_uncond, guidance_scale, result, Oc, T, norm_threshold)
-- Route through native APG C++ implementation
apg(pred_cond, pred_uncond, guidance_scale, result, Oc, T, norm_threshold)
end