lucent
lucent copied to clipboard
Propagating KeyboardInterrupt in render_vis
Currently, when one executes
for i in range(num_channels): _ = render.render_vis(model, objective.channels(layer_name, i))
and then interrupts, e.g. by hitting the stop button in Colab, then it will simply stop the current optimization and then continue to loop. This is annoying for interactive programming. I suggest re-raising the KeyboradInterrupt after catching it with the except. This way the code is still stopped when interrupting from keyboard.