Agustinus Kristiadi
Agustinus Kristiadi
This is because [PyTorch and Huggingface defaults to `-100`](https://pytorch.org/docs/stable/generated/torch.nn.CrossEntropyLoss.html) but ASDL defaults to `-1`.
Thanks a lot, @BlackHC! LGTM, but could you add a test for this here? https://github.com/aleximmer/Laplace/blob/main/tests/test_utils.py
Unfortunately, the maintainer of `SubnetLaplace` (Erik) is not involved anymore. If you only need to do subnet Laplace "per-tensor", you can just disable the grads of the params you don't...
I see, `p.requires_grad = False` won't work since the backward path in the computation graph is blocked. Sure, `SubnetLaplace` is more flexible, but the issue is that it's unmaintained and...
1. For better flexibility, it's better to use `la(..., subset_of_weights="all", ...)` and then just switch of the gradients of the parameters you don't need. E.g. if you want to do...
Addendum: If you branch [`glm_multidim`](https://github.com/aleximmer/Laplace/tree/glm-multidim), then you can use the GLM predictive (better than MC) with caveats: * `hessian_structure in ["full", "diag"]` * You must pass `enable_backprop=True` to `Laplace(...)`, then...
As I said before, `subset_of_weights="last_layer"` is much less flexible. Just set it to `"all"` and switch off gradients
I‘ll keep this open until the aforementioned branch merged. Thanks for opening the issue!
Sorry I missed this issue! I don't quite get the first issue: In the doc, we specified that the `targets` tensor follows PyTorch's `CrossEntropyLoss` convention, i.e. it is an integer...
Something like this? ```python model = ... train_loader = ... model = train_model(model, train_loader) # SGD # Laplace only on encoder for p in model.encoder.parameters(): p.requires_grad = True # Don't...