all these steps in this detailed workflow are depicted in figure - with necessary annotations and equations we would like to thank our good friend christopher olah for providing us detailed information as well as the images for depicting the internal workings of lstm networks we recommend checking out christopher' blog at shout out also goes to edwin chenfor explaining rnns and lstms in an easy-to-understand format we recommend referring to edwin' blog at information on the workings of rnns and lstms figure - walkthrough of data flow in an lstm cell (sourcechristopher olah' blogcolah github iothe final layer in our deep network is the dense layer with unit and the sigmoid activation function we basically use the binary_crossentropy function with the adam optimizer since this is binary classification problem and the model will ultimately predict or which we can decode back to negative or positive sentiment prediction with our label encoder you can also use the categorical_ crossentropy loss function herebut you would need to then use dense layer with units instead with softmax function now that our model is compiled and readywe can head on to step of our classification workflow of actually training the model we use similar strategy from our previous deep network modelswhere we train our model on the training data with five epochsbatch size of reviewsand validation split of training data to measure validation accuracy