Skip to content

Conversation

@Sentz98
Copy link

@Sentz98 Sentz98 commented Dec 17, 2024

This PR introduces the ability to record activations from specific model layers during testing.

Activations are saved in a CSV file for further analysis.
Headers include: Layer Name, Layer Type, Activation Shape, and Activations.

Forward hooks are automatically registered on all leaf modules during testing.
Hooks are automatically removed when recording ends.

Usage Example:

model.enable_activation_recording("path/to/output.csv")
# Run testing loop better if only with one image
model.close_activation_file()

@fpaissan fpaissan self-requested a review December 18, 2024 08:05
@fpaissan
Copy link
Collaborator

Thanks for the contribution. While I can see the value in having such API implemented, I'm not sure of the technical details:

  • saving all activations can result in a huge memory usage, depending on the network activations
  • why do you think csv is the best option for the task?

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

Successfully merging this pull request may close these issues.

2 participants