2

I am using an LSTM layer to multiplex among several memory cells. That said, having several input options, I want to feed only one of them to the hidden layer. I arranged the input to LSTM in such a way, so it would select an apropriate cell based on the input_gate, forget_gate, and output_gate I pass to it in addition to the cell_input.

However, it seems that the LSTM layer transforms the values of the memory cells, while I would expect it to pass them to the output as-is.

For example, I am passing the following input, which I printed in groups corresponding to input_gate, forget_gate, cell_input, and output_gate for convenience:

ig: [ 0.  1.  0.  0.  0.  0.] 
fg: [ 0.  0.  0.  0.  0.  0.]
ci: [ 0.5  0.5  0.5  0.5  0.5  0. ]
og: [ 1.  1.  0.  0.  0.  1.]

I want the LSTM layer to only pass ci[0], ci[1], and ci[5] to the output as the og group indicates. However, what I see in the output buffer is different:

LSTM out: [ 0.16597414  0.23799096  0.1135163   0.1135163   0.1135163   0.]

While not absolutely meaningless to me (the 0-th and 1-th entries are slightly greater than the rest) this output is not the [.5 .5 0. 0. 0.] that I expected.

From what I learned about LSTM, it doesn't seem that there is any transition function from the memory cells to the actual output.

greeness
  • 15,956
  • 5
  • 50
  • 80
user1048677
  • 229
  • 3
  • 13

1 Answers1

1

Silly question, of course: the output is clamped by a sigmoid.

user1048677
  • 229
  • 3
  • 13