Skip to content

Comments

feat(autojac): Make jac_to_grad return optional weights.#585

Closed
PierreQuinton wants to merge 2 commits intomainfrom
make-jac-to-grad-return-weights
Closed

feat(autojac): Make jac_to_grad return optional weights.#585
PierreQuinton wants to merge 2 commits intomainfrom
make-jac-to-grad-return-weights

Conversation

@PierreQuinton
Copy link
Contributor

@PierreQuinton PierreQuinton commented Feb 20, 2026

  • Change aggregator: Aggregator to method: Aggregator | Weighting and return type to optional Tensor.
  • Make method positional only.
  • Add overloads to rename method to aggregator or weighting and link it to output type.
  • Compute the weights if we provide a weighting and return them.
  • Update the doc and add a usage example

What I like are the overloads, they are super smooth with the fact that we can actually specify the names aggregator and weighting. I think this also combine well with the Gramian optimization, for instance if we don't want to make it systematic, then we can add a field use_gramian_optimization.

I think that going this way requires us to refactor the aggregation package. The current error is due to the fact that we call a Gramian weighting on a matrix and not on its gramian.

* Change `aggregator: Aggregator` to `method: Aggregator | Weighting` and return type to optional `Tensor`.
* Make `method` positional only.
* Add overloads to rename `method` to `aggregator` or `weighting` and link it to output type.
* Compute the weights if we provide a weighting and return them.
* Update the doc and add a usage example
@PierreQuinton PierreQuinton added cc: feat Conventional commit type for new features. package: autojac labels Feb 20, 2026
@PierreQuinton
Copy link
Contributor Author

Closed in favor of #586

@PierreQuinton PierreQuinton deleted the make-jac-to-grad-return-weights branch February 21, 2026 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc: feat Conventional commit type for new features. package: autojac

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant