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

GenCast training #118

Closed
dkokron opened this issue Dec 28, 2024 · 1 comment
Closed

GenCast training #118

dkokron opened this issue Dec 28, 2024 · 1 comment

Comments

@dkokron
Copy link

dkokron commented Dec 28, 2024

I am playing with the gencast_mini_demo.ipynb using the 'GenCast 1p0deg Mini <2019.npz' model along with the source-era5_date-2019-03-29_res-1.0_levels-13_steps-01.nc dataset. I added the following commands after the "Gradient computation" cell to see if the training steps changed anything in the params structure. Nothing changed. So the question becomes, what is the training doing? Which fields should I be comparing?

print(np.array_equal(ckpt.params["fourier_features_mlp/~/mlp/~/linear_0"]["b"], params["fourier_features_mlp/~/mlp/~/linear_0"]["b"]))
print(np.array_equal(ckpt.params["fourier_features_mlp/~/mlp/~/linear_0"]["w"], params["fourier_features_mlp/~/mlp/~/linear_0"]["w"]))
print(np.array_equal(ckpt.params["fourier_features_mlp/~/mlp/~/linear_1"]["b"], params["fourier_features_mlp/~/mlp/~/linear_1"]["b"]))
print(np.array_equal(ckpt.params["fourier_features_mlp/~/mlp/~/linear_1"]["w"], params["fourier_features_mlp/~/mlp/~/linear_1"]["w"])) 

True
True
True
True
@alvarosg
Copy link
Collaborator

The grads_fn_jitted only produces the gradients of the params. In order to actually perform an update of the params, then you need to use an optimizer (e.g. Adam from the optax library) to used those gradients to compute an update to the params.

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