We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi Ivan, in the notebook, we have the function
@build_jax_fem_eval(solve_templates) def fenics_solve(f):
I try to use jax.vmap. It works in the test files, where we just want to compute outputs of u. However, inside the neural network
def eval_nn(net_params): f_nn = np.ravel(net_apply(net_params, W.tabulate_dof_coordinates())) u = vmap(fenics_solve(f_nn)) norm_u = np.linalg.norm(u) return norm_u
but it does not work. For example, in the case that we deal with multiple samples. Can you give me further guidance?
Thank you.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi Ivan,
in the notebook, we have the function
@build_jax_fem_eval(solve_templates)
def fenics_solve(f):
I try to use jax.vmap. It works in the test files, where we just want to compute outputs of u. However, inside the neural network
def eval_nn(net_params):
f_nn = np.ravel(net_apply(net_params, W.tabulate_dof_coordinates()))
u = vmap(fenics_solve(f_nn))
norm_u = np.linalg.norm(u)
return norm_u
but it does not work. For example, in the case that we deal with multiple samples.
Can you give me further guidance?
Thank you.
The text was updated successfully, but these errors were encountered: