Adding static data( not changing over time) to sequence data in LSTM

☆樱花仙子☆ 提交于 2019-12-06 12:14:20

I am not sure if I got what you are asking, but I will try.

Example in Keras:

static_out = (static_input)

x = LSTM(n_cell_lstm, return_sequences=True)(dynamic_input)
x = Flatten()(x)
dynamic_out = (x)

z = concatenate([dynamic_out, static_out])

z = Dense(64, activation='relu')(z)

main_output = Dense(classes, activation='softmax', name='main_output')(z)

Practically you are using an LSTM architecture as you would if you where using only the dynamic data, but at the end you add the info coming from the static data. Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!