Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Neural Networks with Keras

You're reading from  Hands-On Neural Networks with Keras

Product type Book
Published in Mar 2019
Publisher Packt
ISBN-13 9781789536089
Pages 462 pages
Edition 1st Edition
Languages
Author (1):
Niloy Purkait Niloy Purkait
Profile icon Niloy Purkait

Table of Contents (16) Chapters

Preface 1. Section 1: Fundamentals of Neural Networks
2. Overview of Neural Networks 3. A Deeper Dive into Neural Networks 4. Signal Processing - Data Analysis with Neural Networks 5. Section 2: Advanced Neural Network Architectures
6. Convolutional Neural Networks 7. Recurrent Neural Networks 8. Long Short-Term Memory Networks 9. Reinforcement Learning with Deep Q-Networks 10. Section 3: Hybrid Model Architecture
11. Autoencoders 12. Generative Networks 13. Section 4: Road Ahead
14. Contemplating Present and Future Developments 15. Other Books You May Enjoy

Building LSTMs

Now that we have some baseline models in place, let's proceed by constructing what this chapter is all about: an LSTM. We will first start with a plain one-layer LSTM with no dropout strategy, equipping it with 32 neurons as follows:

def simple_lstm():
    model = Sequential()
    model.add(LSTM(32, input_shape=(1, 7)))
    
    model.add(Dense(1, activation='linear'))
    
    model.compile(loss='mae', optimizer='adam')
    return model

We connect the LSTM layer to our dense regressor layer, and continue to use the same loss and optimizer and loss functions.

Stacked LSTM

Next, we simply stack two LSTM layers on top of each other, just like we did with the GRUs in the previous...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}