-
Notifications
You must be signed in to change notification settings - Fork 47
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
Calculated Hessian for the elastic example. It gives zero values #64
Comments
Here is the complete code ny = 100 vp_background = torch.ones(ny, nx, device=device) * 1500 vp_true = vp_background.clone() n_shots = 8 n_sources_per_shot = 1 n_receivers_per_shot = nx-1 freq = 15 source_locationssource_locations = torch.zeros(n_shots, n_sources_per_shot, 2, receiver_locationsreceiver_locations = torch.zeros(n_shots, n_receivers_per_shot, 2, source_amplitudessource_amplitudes = ( def wrap(vp,vs,rho): hess = torch.autograd.functional.hessian(wrap, (vp, vs, rho)) |
Hello, and thank you for your question and full code. I am glad to
hear that you are interested in the new Hessian feature.
Unfortunately, however, double backpropagation (which is needed to
calculate the Hessian) is currently only supported for the scalar
propagator. I will try to clarify this in the documentation. I am
sorry that it was not previously sufficiently clear, causing you to
waste time on this.
|
I calculated the full hessian (using the method : https://ausargeo.com/deepwave/example_hessian) for the model in elastic FWI example (https://ausargeo.com/deepwave/example_elastic). got zero values between vp and vs. Attaching plot of the hessian.
Here is the code snippet
def wrap(vp,vs,rho):
out = deepwave.elastic(
*deepwave.common.vpvsrho_to_lambmubuoyancy(vp, vs, rho),
dx, dt,
source_amplitudes_y=source_amplitudes,
source_locations_y=source_locations,
receiver_locations_y=receiver_locations,
pml_freq=freq,
)[-2]
return loss_fn(out, observed_data)
hess = torch.autograd.functional.hessian(wrap, (vp, vs, rho))
The text was updated successfully, but these errors were encountered: