You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR introduces a class CurvatureLinearOperator, which is almost identical to the current base class _LinearOperator, but inherits from PyTorchLinearOperator.
The next steps will be to (i) migrate each linear operator to inherit from CurvatureLinearOperator, rather than _LinearOperator, (ii) delete _LinearOperator.
Added the following test: In this PR, CurvatureLinearOperator has two public functions: to_device, and gradient_and_loss. The to_device function will be deprecated soon, therefore I am not adding a test here (it is also called by the other linear operators in their deterministic checks, therefore tested indirectly). I added an explicit test which makes sure that the loss and gradient are correctly accumulated over a data set. This functionality was tested indirectly before by making sure the curvature matrix-vector products are correctly accumulated over a data set. Now there is an explicit test which only relies on the base class.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a class
CurvatureLinearOperator
, which is almost identical to the current base class_LinearOperator
, but inherits fromPyTorchLinearOperator
.The next steps will be to (i) migrate each linear operator to inherit from
CurvatureLinearOperator
, rather than_LinearOperator
, (ii) delete_LinearOperator
.