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

Using K-FAC with physics-based losses #186

Open
SNMS95 opened this issue Nov 14, 2023 · 3 comments
Open

Using K-FAC with physics-based losses #186

SNMS95 opened this issue Nov 14, 2023 · 3 comments

Comments

@SNMS95
Copy link

SNMS95 commented Nov 14, 2023

Hey,

Thank you for the implementation.

From the guide, I saw that I have to register loss functions to be able to use K-FAC.
For my specific case, the loss function is a FEM simulation on the outputs of the network along with some other functions (postprocessing, filtering etc).

Will it be possible to use K-FAC?

@SNMS95
Copy link
Author

SNMS95 commented Nov 17, 2023

@james-martens

Hi James,

Is it possible to create a custom loss for KFAC?

@SNMS95
Copy link
Author

SNMS95 commented Nov 29, 2023

Hey,

Thank you for the implementation.

From the guide, I saw that I have to register loss functions to be able to use K-FAC. For my specific case, the loss function is a FEM simulation on the outputs of the network along with some other functions (postprocessing, filtering etc).

Will it be possible to use K-FAC?

Hi,

Has there been any update on it?

@james-martens
Copy link
Collaborator

Hi,

Sorry for the late reply.

The K-FAC method is based on the generalized Gauss-Newton matrix (GGN), which required a convex loss (as a function of the network's output). If your loss is convex then you could implement your loss function class and registration functions, similar to the ones that exist already in the package. We won't be accepting any contributions, but you're free to do this in your own fork or via careful importing and sublassing.

Another possibility here is that you might want to view parts of your complicated loss function as being formally part of the network function. If the remainder of the loss function is convex, or even better has the form of an already supported loss function, then that could work too.

James

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

2 participants