MATLAB Answers

Visualization of activation for LSTM

11 views (last 30 days)
Pierre Harouimi
Pierre Harouimi on 3 Dec 2018
Edited: Stuart Whipp on 10 Dec 2018
Like deepDreamImage for CNN layers visualization, is there any approach to check/analyze activations of a LSTM layer into MATLAB ?
My workaround for now is to change my TS to image and then check activations, but it is not perfect.

  2 Comments

Stuart Whipp
Stuart Whipp on 10 Dec 2018
Hi,
I recently posted this for yielding activations from an LSTM network.
Simply copy into a .m file (or save attachment) and call as per the usual activation function (specifying layer as a number rather than by name). The basic premise is to slice the end of your network, and place a regression output just after the layer of interest. This will show activations of specified layer as they would be passed to a subsequent layer during 'normal operation
This should work for all SeriesNetworks, I don't think it would work for a DAGnetwork but could amend it to work surely.
Cheers
Stuart
Stuart Whipp
Stuart Whipp on 10 Dec 2018
Incidentally, LSTM doesn't work with DAG anyway. I think this is exactly what you're looking for in terms of activations from LSTM/BiLSTM. It's not the same thing as 'deepDreamImage' of course, but the usual 'activations' function which I'm sure you've realised only works for non recurrent networks.
As I understand, DeepDream is like saying 'what change to the inputs would make the activation more pronounced upon this layer/channel'. In this manner, we can show the net a picture of a cat and ask what change to said input would make the network assume the answer was say, chicken? Pareidolia
Wikipedia actually gives a good overview. It's essentially running a layer backwards to reverse engineer a desired output. It results in trippy images where small artefacts are overprocessed to produce what look like chicken features on our original cat image.

Sign in to comment.

Answers (0)

Sign in to answer this question.