Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question About optimising the prior variance using marginal likelihood #4

Open
xuullin opened this issue Sep 1, 2024 · 0 comments
Open

Comments

@xuullin
Copy link

xuullin commented Sep 1, 2024

Could you clarify the role of 1 / t.linalg.norm(s2) * map_norms in the model evidence formula? Specifically, how does the normalization by t.linalg.norm(s2) affect the contribution of map_norms to the overall model evidence?

When maximizing the marginal likelihood, should we include a negative sign in front of the model evidence term to properly adjust for the optimization algorithm’s minimization objective? If not, could you clarify how the model evidence is being handled in the optimization process?

map_norms = 0.0
lora_params = {
    k: v
    for k, v in dict(model.named_parameters()).items()
    if "lora" in k.lower() and v.requires_grad
}
for i, param in enumerate(lora_params.values()):
    map_norms += t.linalg.norm(param)
model_evidence = LL + 1 / t.linalg.norm(s2) * map_norms + 0.5 * logdet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant