What you ask are auto-coders, you can find similar structures in Keras.
But there are some details that you must understand on your own. Including a filling strategy and preprocessing of your input and output. Your input cannot get dynamic input size, so you need to have a fixed length for input and output. I donβt know what you mean by arrows that join the same circle, but I think you can take a look at Merge Layer in Keras (basically adding, concatenating, etc.)
You will probably need 4 sequential and one final model , which are a combined structure.
One more thing: installing an LSTM decoder (language model) is not dynamic in design. In defining a model, you basically enter fixed inputs and outputs for it. Then you prepare the training correctly, so you do not need anything dynamic. Then, during the test, you can predict each decoded word in a loop by running the model after predicting the next output step and running it again for the next time step and so on.
source share