# How to extract the last time steps from two or more LSTM networks and add several density layers to form a computational graph?

**URL:** <https://community.konduit.ai/t/how-to-extract-the-last-time-steps-from-two-or-more-lstm-networks-and-add-several-density-layers-to-form-a-computational-graph/2714>\
**Category:** DL4J\
**Created:** [July 31, 2023, 5:49am UTC](https://community.konduit.ai/t/how-to-extract-the-last-time-steps-from-two-or-more-lstm-networks-and-add-several-density-layers-to-form-a-computational-graph/2714 "2023-07-31T05:49:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cqiaoYc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/cqiaoyc/32/738_2.png) [@cqiaoYc](https://community.konduit.ai/u/cqiaoYc)\
**Post date:** [July 31, 2023, 5:49am UTC](https://community.konduit.ai/t/how-to-extract-the-last-time-steps-from-two-or-more-lstm-networks-and-add-several-density-layers-to-form-a-computational-graph/2714/1 "2023-07-31T05:49:33Z")

</div>

I want to use 2-3 LSTM networks as feature selectors, extract the last time steps of LSTM networks as the input layer, and then add several density layers to build a computation graph. How can I use a computation graph to build it?

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [July 31, 2023, 9:24am UTC](https://community.konduit.ai/t/how-to-extract-the-last-time-steps-from-two-or-more-lstm-networks-and-add-several-density-layers-to-form-a-computational-graph/2714/2 "2023-07-31T09:24:07Z")

</div>

@cqiaoYc have you tried anything so far? Normally that should just be the LastTimeStepVertex after each LSTM followed by a potenial reshape in to dense from the sounds of it. Have you tried just building 1 part of this at a time?

---

<div class="post-metadata">

**Author:** ![cqiaoYc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/cqiaoyc/32/738_2.png) [@cqiaoYc](https://community.konduit.ai/u/cqiaoYc)\
**Post date:** [August 10, 2023, 12:55pm UTC](https://community.konduit.ai/t/how-to-extract-the-last-time-steps-from-two-or-more-lstm-networks-and-add-several-density-layers-to-form-a-computational-graph/2714/3 "2023-08-10T12:55:07Z")

</div>

the LastTimeStepVertex works fine, thank you!
