Replies: 2 comments
-
You can extract intermediate output by using a hook. for example intermediate_output = None
# Define a hook for the specific layer
def hook_fn(module, input, output):
global intermediate_output
intermediate_output = output
# Register the hook on the specific layer using its path
# You can modify the path below to match the exact path of the layer you're interested in, in your case, this would be the descriptor
layer_path = "atomic_model.fitting_net.filter_layers.networks.0.layers.2.activate"
hook = mm.get_submodule(layer_path).register_forward_hook(hook_fn)
# Perform a forward pass through the model
output = mm(input_coord, input_atype)
# Now 'intermediate_output' contains the output of the specified layer
print(intermediate_output)
# Don't forget to remove the hook after you're done to avoid side effects
hook.remove() |
Beta Was this translation helpful? Give feedback.
0 replies
-
Please use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have trained a DP with se_e2_a descriptor. Now, I would like to use this DP to infer the descriptor tensor for each atomic local environment. How can I do? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions