tensorflow / lucid

A collection of infrastructure and tools for research in neural network interpretability.
Apache License 2.0
4.64k stars 652 forks source link

[scratch/rl_util] attribution score_fn fix #263

Closed jacobhilton closed 3 years ago

jacobhilton commented 3 years ago

Fixes an issue whereby the score function for attribution is allowed to reduce over the batch dimension, even though that dimension should always be summed over. This causes unexpected behavior when passing in tf.reduce_max, for example. Instead, an exception is now raised advising what should be passed in instead.