Skip to content

How can we export the data generated during the calculation process in the model? #1975

Answered by PhilipVinc
usernamesjh asked this question in Q&A
Discussion options

You must be logged in to vote

This is not a netket-specific question, but rather a jax specific one. You should ask it other at https://github.com/jax-ml/jax .
This is a common question in jax.

Regardless, the issue here is that you have a network and it is Jitted, so you cannot insert arbitrary functions.
The solution would be to use a jax.pure_callback or more appropriately a jax.experimental.io_Callback if you want to save to file.

If you want to print the content of an array inside a jitted function, instead, you should not do print(x) but you should use jax.debug.print and do something like

jax.debug.print("my array {}", x)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@usernamesjh
Comment options

Answer selected by usernamesjh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants