Get output at each timestep of RNN

43 views
Skip to first unread message

Daniel McKenna

unread,
Mar 26, 2020, 11:31:31 AM3/26/20
to Rust for TensorFlow
I've got a frozen network with an RNN, I feed in the inputs and fetch an output from the `SessionRunArgs` but that's just for the last timestep, is there a way to get a 2D tensor with the output at every timestep?

Adam Crume

unread,
Mar 27, 2020, 2:26:37 PM3/27/20
to Daniel McKenna, Rust for TensorFlow
How is your RNN built, i.e. what does the graph look like?  You should be able to call SessionRunArgs::request_fetch for everything you want an output for, so you just need to find the operation in your graph that holds what you want.  Or does this do something interesting like use tf.while_loop?  If that's the case, then I'm not sure if there's an easy way to do it.  You may need to modify your graph to write the intermediate values to a variable so you can retrieve them later.

On Thu, Mar 26, 2020 at 8:31 AM Daniel McKenna <danielm...@gmail.com> wrote:
I've got a frozen network with an RNN, I feed in the inputs and fetch an output from the `SessionRunArgs` but that's just for the last timestep, is there a way to get a 2D tensor with the output at every timestep?

--
You received this message because you are subscribed to the Google Groups "Rust for TensorFlow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rust+uns...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/rust/5c5942ca-369d-4ae5-888c-f37a7af55909%40tensorflow.org.

Daniel McKenna

unread,
Apr 27, 2020, 12:05:24 PM4/27/20
to Rust for TensorFlow
Yeah I managed to do it by modifying the graph to get the intermediate values 
Reply all
Reply to author
Forward
0 new messages