100% found this document useful (4 votes)
29 views

(Ebook) Deep Learning with Python: Develop Deep Learning Models on Theano and TensorFLow Using Keras by Jason Brownlee download

The document is a collection of ebooks focused on deep learning, covering various topics and frameworks such as Theano, TensorFlow, and Keras. It includes links to purchase and download these ebooks, which are designed for readers interested in developing deep learning models. The content spans introductory material to advanced projects and applications in deep learning.

Uploaded by

gwuvjma1642
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
29 views

(Ebook) Deep Learning with Python: Develop Deep Learning Models on Theano and TensorFLow Using Keras by Jason Brownlee download

The document is a collection of ebooks focused on deep learning, covering various topics and frameworks such as Theano, TensorFlow, and Keras. It includes links to purchase and download these ebooks, which are designed for readers interested in developing deep learning models. The content spans introductory material to advanced projects and applications in deep learning.

Uploaded by

gwuvjma1642
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

(Ebook) Deep Learning with Python: Develop Deep

Learning Models on Theano and TensorFLow Using


Keras by Jason Brownleeinstall download

https://ebooknice.com/product/deep-learning-with-python-develop-
deep-learning-models-on-theano-and-tensorflow-using-keras-7295338

Download more ebook instantly today at https://ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Deep Learning for Natural Language Processing: Develop Deep Learning Models
for Natural Language in Python by Jason Brownlee

https://ebooknice.com/product/deep-learning-for-natural-language-processing-
develop-deep-learning-models-for-natural-language-in-python-11575184

ebooknice.com

(Ebook) Deep Learning for Natural Language Processing: Develop Deep Learning Models
for your Natural Language Problems by Jason Brownlee

https://ebooknice.com/product/deep-learning-for-natural-language-processing-
develop-deep-learning-models-for-your-natural-language-problems-42525080

ebooknice.com

(Ebook) Deep Learning Projects Using TensorFlow 2: Neural Network Development with
Python and Keras by Vinita Silaparasetty ISBN 9781484258019, 1484258010

https://ebooknice.com/product/deep-learning-projects-using-tensorflow-2-neural-
network-development-with-python-and-keras-11300868

ebooknice.com

(Ebook) Deep Learning with Keras: Implementing Deep Learning Models and Neural
Networks with the power of Python by Antonio Gulli, Sujit Pal ISBN 9781787128422,
1787128423

https://ebooknice.com/product/deep-learning-with-keras-implementing-deep-
learning-models-and-neural-networks-with-the-power-of-python-7360028

ebooknice.com
(Ebook) Automated Deep Learning Using Neural Network Intelligence: Develop and
Design PyTorch and TensorFlow Models by Ivan Gridin ISBN 9781484281482, 1484281489

https://ebooknice.com/product/automated-deep-learning-using-neural-network-
intelligence-develop-and-design-pytorch-and-tensorflow-models-43639012

ebooknice.com

(Ebook) Learn TensorFlow 2.0: Implement Machine Learning and Deep Learning Models
with Python by Pramod Singh , Avinash Manure ISBN 9781484255582, 1484255585

https://ebooknice.com/product/learn-tensorflow-2-0-implement-machine-learning-
and-deep-learning-models-with-python-50195358

ebooknice.com

(Ebook) Applied Deep Learning with TensorFlow 2: Learn to Implement Advanced Deep
Learning Techniques with Python by Umberto Michelucci ISBN 9781484280195, 1484280199

https://ebooknice.com/product/applied-deep-learning-with-tensorflow-2-learn-to-
implement-advanced-deep-learning-techniques-with-python-42639904

ebooknice.com

(Ebook) Deep Learning with Applications Using Python Chatbots and Face, Object, and
Speech Recognition With TensorFlow and Keras by SpringerLink (Online service);
Manaswi, Navin Kumar ISBN 9781484235157, 9781484235164, 1484235150, 1484235169

https://ebooknice.com/product/deep-learning-with-applications-using-python-
chatbots-and-face-object-and-speech-recognition-with-tensorflow-and-
keras-18707172

ebooknice.com

(Ebook) Computer Vision Using Deep Learning: Neural Network Architectures with
Python and Keras by Vaibhav Verdhan ISBN 9781484266151, 1484266153

https://ebooknice.com/product/computer-vision-using-deep-learning-neural-
network-architectures-with-python-and-keras-24606292

ebooknice.com
   

��������������������������������
����������������������������
�����

��������������
Jason Brownlee

Deep Learning With Python


Develop Deep Learning Models On Theano And TensorFlow Using
Keras
i

Deep Learning With Python


Copyright 2016 Jason Brownlee. All Rights Reserved.

Edition: v1.7
Contents

Preface iii

I Introduction 1
1 Welcome 2
1.1 Deep Learning The Wrong Way . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Deep Learning With Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Book Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Requirements For This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5 Your Outcomes From Reading This Book . . . . . . . . . . . . . . . . . . . . . . 7
1.6 What This Book is Not . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

II Background 10
2 Introduction to Theano 11
2.1 What is Theano? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 How to Install Theano . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3 Simple Theano Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4 Extensions and Wrappers for Theano . . . . . . . . . . . . . . . . . . . . . . . . 13
2.5 More Theano Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

3 Introduction to TensorFlow 15
3.1 What is TensorFlow? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 How to Install TensorFlow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3 Your First Examples in TensorFlow . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.4 Simple TensorFlow Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5 More Deep Learning Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

4 Introduction to Keras 19
4.1 What is Keras? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2 How to Install Keras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.3 Theano and TensorFlow Backends for Keras . . . . . . . . . . . . . . . . . . . . 20

ii
iii

4.4 Build Deep Learning Models with Keras . . . . . . . . . . . . . . . . . . . . . . 21


4.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5 Project: Develop Large Models on GPUs Cheaply In the Cloud 23


5.1 Project Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.2 Setup Your AWS Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.3 Launch Your Server Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.4 Login, Configure and Run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.5 Build and Run Models on AWS . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.6 Close Your EC2 Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.7 Tips and Tricks for Using Keras on AWS . . . . . . . . . . . . . . . . . . . . . . 34
5.8 More Resources For Deep Learning on AWS . . . . . . . . . . . . . . . . . . . . 34
5.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

III Multilayer Perceptrons 36


6 Crash Course In Multilayer Perceptrons 37
6.1 Crash Course Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6.2 Multilayer Perceptrons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6.3 Neurons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6.4 Networks of Neurons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.5 Training Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

7 Develop Your First Neural Network With Keras 43


7.1 Tutorial Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
7.2 Pima Indians Onset of Diabetes Dataset . . . . . . . . . . . . . . . . . . . . . . 44
7.3 Load Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.4 Define Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.5 Compile Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.6 Fit Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.7 Evaluate Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.8 Tie It All Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

8 Evaluate The Performance of Deep Learning Models 51


8.1 Empirically Evaluate Network Configurations . . . . . . . . . . . . . . . . . . . 51
8.2 Data Splitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
8.3 Manual k-Fold Cross Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
8.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

9 Use Keras Models With Scikit-Learn For General Machine Learning 57


9.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
9.2 Evaluate Models with Cross Validation . . . . . . . . . . . . . . . . . . . . . . . 58
9.3 Grid Search Deep Learning Model Parameters . . . . . . . . . . . . . . . . . . . 59
9.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
iv

10 Project: Multiclass Classification Of Flower Species 62


10.1 Iris Flowers Classification Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . 62
10.2 Import Classes and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
10.3 Initialize Random Number Generator . . . . . . . . . . . . . . . . . . . . . . . . 63
10.4 Load The Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
10.5 Encode The Output Variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
10.6 Define The Neural Network Model . . . . . . . . . . . . . . . . . . . . . . . . . 65
10.7 Evaluate The Model with k-Fold Cross Validation . . . . . . . . . . . . . . . . . 65
10.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

11 Project: Binary Classification Of Sonar Returns 68


11.1 Sonar Object Classification Dataset . . . . . . . . . . . . . . . . . . . . . . . . . 68
11.2 Baseline Neural Network Model Performance . . . . . . . . . . . . . . . . . . . . 69
11.3 Improve Performance With Data Preparation . . . . . . . . . . . . . . . . . . . 71
11.4 Tuning Layers and Neurons in The Model . . . . . . . . . . . . . . . . . . . . . 73
11.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

12 Project: Regression Of Boston House Prices 77


12.1 Boston House Price Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
12.2 Develop a Baseline Neural Network Model . . . . . . . . . . . . . . . . . . . . . 78
12.3 Lift Performance By Standardizing The Dataset . . . . . . . . . . . . . . . . . . 81
12.4 Tune The Neural Network Topology . . . . . . . . . . . . . . . . . . . . . . . . . 82
12.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

IV Advanced Multilayer Perceptrons and Keras 86


13 Save Your Models For Later With Serialization 87
13.1 Tutorial Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
13.2 Save Your Neural Network Model to JSON . . . . . . . . . . . . . . . . . . . . . 88
13.3 Save Your Neural Network Model to YAML . . . . . . . . . . . . . . . . . . . . 90
13.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

14 Keep The Best Models During Training With Checkpointing 93


14.1 Checkpointing Neural Network Models . . . . . . . . . . . . . . . . . . . . . . . 93
14.2 Checkpoint Neural Network Model Improvements . . . . . . . . . . . . . . . . . 94
14.3 Checkpoint Best Neural Network Model Only . . . . . . . . . . . . . . . . . . . 95
14.4 Loading a Saved Neural Network Model . . . . . . . . . . . . . . . . . . . . . . 96
14.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

15 Understand Model Behavior During Training By Plotting History 98


15.1 Access Model Training History in Keras . . . . . . . . . . . . . . . . . . . . . . 98
15.2 Visualize Model Training History in Keras . . . . . . . . . . . . . . . . . . . . . 99
15.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
v

16 Reduce Overfitting With Dropout Regularization 102


16.1 Dropout Regularization For Neural Networks . . . . . . . . . . . . . . . . . . . . 102
16.2 Dropout Regularization in Keras . . . . . . . . . . . . . . . . . . . . . . . . . . 103
16.3 Using Dropout on the Visible Layer . . . . . . . . . . . . . . . . . . . . . . . . . 104
16.4 Using Dropout on Hidden Layers . . . . . . . . . . . . . . . . . . . . . . . . . . 105
16.5 Tips For Using Dropout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
16.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

17 Lift Performance With Learning Rate Schedules 108


17.1 Learning Rate Schedule For Training Models . . . . . . . . . . . . . . . . . . . . 108
17.2 Ionosphere Classification Dataset . . . . . . . . . . . . . . . . . . . . . . . . . . 109
17.3 Time-Based Learning Rate Schedule . . . . . . . . . . . . . . . . . . . . . . . . 109
17.4 Drop-Based Learning Rate Schedule . . . . . . . . . . . . . . . . . . . . . . . . . 112
17.5 Tips for Using Learning Rate Schedules . . . . . . . . . . . . . . . . . . . . . . . 114
17.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

V Convolutional Neural Networks 115


18 Crash Course In Convolutional Neural Networks 116
18.1 The Case for Convolutional Neural Networks . . . . . . . . . . . . . . . . . . . . 116
18.2 Building Blocks of Convolutional Neural Networks . . . . . . . . . . . . . . . . . 117
18.3 Convolutional Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
18.4 Pooling Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
18.5 Fully Connected Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
18.6 Worked Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
18.7 Convolutional Neural Networks Best Practices . . . . . . . . . . . . . . . . . . . 119
18.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

19 Project: Handwritten Digit Recognition 121


19.1 Handwritten Digit Recognition Dataset . . . . . . . . . . . . . . . . . . . . . . . 121
19.2 Loading the MNIST dataset in Keras . . . . . . . . . . . . . . . . . . . . . . . . 122
19.3 Baseline Model with Multilayer Perceptrons . . . . . . . . . . . . . . . . . . . . 123
19.4 Simple Convolutional Neural Network for MNIST . . . . . . . . . . . . . . . . . 127
19.5 Larger Convolutional Neural Network for MNIST . . . . . . . . . . . . . . . . . 131
19.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134

20 Improve Model Performance With Image Augmentation 135


20.1 Keras Image Augmentation API . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
20.2 Point of Comparison for Image Augmentation . . . . . . . . . . . . . . . . . . . 136
20.3 Feature Standardization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
20.4 ZCA Whitening . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
20.5 Random Rotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
20.6 Random Shifts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
20.7 Random Flips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
20.8 Saving Augmented Images to File . . . . . . . . . . . . . . . . . . . . . . . . . . 145
20.9 Tips For Augmenting Image Data with Keras . . . . . . . . . . . . . . . . . . . 147
vi

20.10Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

21 Project Object Recognition in Photographs 148


21.1 Photograph Object Recognition Dataset . . . . . . . . . . . . . . . . . . . . . . 148
21.2 Loading The CIFAR-10 Dataset in Keras . . . . . . . . . . . . . . . . . . . . . . 149
21.3 Simple CNN for CIFAR-10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
21.4 Larger CNN for CIFAR-10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
21.5 Extensions To Improve Model Performance . . . . . . . . . . . . . . . . . . . . . 157
21.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

22 Project: Predict Sentiment From Movie Reviews 159


22.1 Movie Review Sentiment Classification Dataset . . . . . . . . . . . . . . . . . . 159
22.2 Load the IMDB Dataset With Keras . . . . . . . . . . . . . . . . . . . . . . . . 160
22.3 Word Embeddings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
22.4 Simple Multilayer Perceptron Model . . . . . . . . . . . . . . . . . . . . . . . . 163
22.5 One-Dimensional Convolutional Neural Network . . . . . . . . . . . . . . . . . . 165
22.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

VI Recurrent Neural Networks 169


23 Crash Course In Recurrent Neural Networks 170
23.1 Support For Sequences in Neural Networks . . . . . . . . . . . . . . . . . . . . . 170
23.2 Recurrent Neural Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
23.3 Long Short-Term Memory Networks . . . . . . . . . . . . . . . . . . . . . . . . . 172
23.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

24 Time Series Prediction with Multilayer Perceptrons 174


24.1 Problem Description: Time Series Prediction . . . . . . . . . . . . . . . . . . . . 174
24.2 Multilayer Perceptron Regression . . . . . . . . . . . . . . . . . . . . . . . . . . 176
24.3 Multilayer Perceptron Using the Window Method . . . . . . . . . . . . . . . . . 181
24.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

25 Time Series Prediction with LSTM Recurrent Neural Networks 185


25.1 LSTM Network For Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
25.2 LSTM For Regression Using the Window Method . . . . . . . . . . . . . . . . . 189
25.3 LSTM For Regression with Time Steps . . . . . . . . . . . . . . . . . . . . . . . 191
25.4 LSTM With Memory Between Batches . . . . . . . . . . . . . . . . . . . . . . . 194
25.5 Stacked LSTMs With Memory Between Batches . . . . . . . . . . . . . . . . . . 197
25.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200

26 Project: Sequence Classification of Movie Reviews 201


26.1 Simple LSTM for Sequence Classification . . . . . . . . . . . . . . . . . . . . . . 201
26.2 LSTM For Sequence Classification With Dropout . . . . . . . . . . . . . . . . . 203
26.3 LSTM and CNN For Sequence Classification . . . . . . . . . . . . . . . . . . . . 206
26.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
vii

27 Understanding Stateful LSTM Recurrent Neural Networks 209


27.1 Problem Description: Learn the Alphabet . . . . . . . . . . . . . . . . . . . . . 209
27.2 LSTM for Learning One-Char to One-Char Mapping . . . . . . . . . . . . . . . 211
27.3 LSTM for a Feature Window to One-Char Mapping . . . . . . . . . . . . . . . . 214
27.4 LSTM for a Time Step Window to One-Char Mapping . . . . . . . . . . . . . . 216
27.5 LSTM State Maintained Between Samples Within A Batch . . . . . . . . . . . . 218
27.6 Stateful LSTM for a One-Char to One-Char Mapping . . . . . . . . . . . . . . . 221
27.7 LSTM with Variable Length Input to One-Char Output . . . . . . . . . . . . . . 224
27.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

28 Project: Text Generation With Alice in Wonderland 228


28.1 Problem Description: Text Generation . . . . . . . . . . . . . . . . . . . . . . . 228
28.2 Develop a Small LSTM Recurrent Neural Network . . . . . . . . . . . . . . . . . 229
28.3 Generating Text with an LSTM Network . . . . . . . . . . . . . . . . . . . . . . 234
28.4 Larger LSTM Recurrent Neural Network . . . . . . . . . . . . . . . . . . . . . . 237
28.5 Extension Ideas to Improve the Model . . . . . . . . . . . . . . . . . . . . . . . 240
28.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

VII Conclusions 242


29 How Far You Have Come 243

30 Getting More Help 244


30.1 Artificial Neural Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
30.2 Deep Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
30.3 Python Machine Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
30.4 Keras Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Preface

Deep learning is a fascinating field. Artificial neural networks have been around for a long time,
but something special has happened in recent years. The mixture of new faster hardware, new
techniques and highly optimized open source libraries allow very large networks to be created
with frightening ease.
This new wave of much larger and much deeper neural networks are also impressively skillful
on a range of problems. I have watched over recent years as they tackle and handily become
state-of-the-art across a range of difficult problem domains. Not least object recognition, speech
recognition, sentiment classification, translation and more.
When a technique comes a long that does so well on such a broad set of problems, you have
to pay attention. The problem is where do you start with deep learning? I created this book
because I thought that there was no gentle way for Python machine learning practitioners to
quickly get started developing deep learning models.
In developing the lessons in this book, I chose the best of breed Python deep learning library
called Keras that abstracted away all of the complexity, ruthlessly leaving you an API containing
only what you need to know to efficiently develop and evaluate neural network models.
This is the guide that I wish I had when I started apply deep learning to machine learning
problems. I hope that you find it useful on your own projects and have as much fun applying
deep learning as I did in creating this book for you.

Jason Brownlee
Melbourne, Australia
2016

viii
Visit https://ebooknice.com to
discover a wide range of
eBooks across various genres.
Enjoy exclusive deals and
discounts to enhance your
reading experience. Start your
digital reading journey today!
Part I

Introduction

1
Chapter 1

Welcome

Welcome to Deep Learning With Python. This book is your guide to deep learning in Python.
You will discover the Keras Python library for deep learning and how to use it to develop and
evaluate deep learning models. In this book you will discover the techniques, recipes and skills
in deep learning that you can then bring to your own machine learning projects.
Deep learning does have a lot of fascinating math under the covers, but you do not need
to know it to be able to pick it up as a tool and wield it on important projects and deliver
real value. From the applied perspective, deep learning is quite a shallow field and a motivated
developer can quickly pick it up and start making very real and impactful contributions. This is
my goal for you and this book is your ticket to that outcome.

1.1 Deep Learning The Wrong Way


If you ask a deep learning practitioner how to get started with neural networks and deep learning,
what do they say? They say things like

You must have a strong foundation in linear algebra.

You must have a deep knowledge of traditional neural network techniques.

You really must know about probability and statistics.

You should really have a deep knowledge of machine learning.

You probably need to be a PhD in computer science.

You probably need 10 years of experience as a machine learning developer.

You can see that the “common sense” advice means that it is not until after you have
completed years of study and experience that you are ready to actually start developing and
evaluating machine learning model for your machine learning projects.
I think this advice is dead wrong.

2
1.2. Deep Learning With Python 3

1.2 Deep Learning With Python


The approach taken with this book and with all of Machine Learning Mastery is to flip the
traditional approach. If you are interested in deep learning, start by developing and evaluating
deep learning models. Then if you discover you really like it or have a knack for it, later you
can step deeper and deeper into the background and theory, as you need it in order to serve
you in developing better and more valuable results. This book is your ticket to jumping in and
making a ruckus with deep learning.
I have used many of the top deep learning platforms and libraries and I chose what I think
is the best-of-breed platform for getting started and very quickly developing powerful and even
state-of-the-art deep learning models in the Keras deep learning library for Python. Unlike R,
Python is a fully featured programming language allowing you to use the same libraries and
code for model development as you can use in production. Unlike Java, Python has the SciPy
stack for scientific computing and scikit-learn which is a professional grade machine library.
There are two top numerical platforms for developing deep learning models, they are Theano
developed by the University of Montreal and TensorFlow developed at Google. Both were
developed for use in Python and both can be leveraged by the super simple to use Keras library.
Keras wraps the numerical computing complexity of Theano and TensorFlow providing a concise
API that we will use to develop our own neural network and deep learning models.
You will develop your own and perhaps your first neural network and deep learning models
while working through this book, and you will have the skills to bring this amazing new
technology to your own projects. It is going to be a fun journey and I can’t wait to start.

1.3 Book Organization


This book is broken down into three parts.

Lessons where you learn about specific features of neural network models and or how to
use specific aspects of the Keras API.

Projects where you will pull together multiple lessons into an end-to-end project and
deliver a result, providing a template your your own projects.

Recipes where you can copy and paste the standalone code into your own project,
including all of the code presented in this book.

1.3.1 Lessons and Projects


Lessons are discrete and are focused on one topic, designed for you to complete in one sitting.
You can take as long as you need, from 20 minutes if you are racing through, to hours if you
want to experiment with the code or ideas and improve upon the presented results. Your lessons
are divided into five parts:

Background.

Multilayer Perceptrons.

Advanced Multilayer Perceptrons and Keras.


1.3. Book Organization 4

Convolutional Neural Networks.


Recurrent Neural Networks.

1.3.2 Part 2: Background


In this part you will learn about the Theano, TensorFlow and Keras libraries that lay the
foundation for your deep learning journey and about how you can leverage very cheap Amazon
Web Service computing in order to develop and evaluate your own large models in the cloud.
This part of the book includes the following lessons:
Introduction to the Theano Numerical Library.
Introduction to the TensorFlow Numerical Library.
Introduction to the Keras Deep Learning Library.
The lessons will introduce you to the important foundational libraries that you need to
install and use on your workstation. This is taken one step further in a project that shows how
you can cheaply harness GPU cloud computing to develop and evaluate very large deep learning
models.
Project: Develop Large Models on GPUs Cheaply In the Cloud.
At the end of this part you will be ready to start developing models in Keras on your
workstation or in the cloud.

1.3.3 Part 3: Multilayer Perceptrons


In this part you will learn about feedforward neural networks that may be deep or not and how
to expertly develop your own networks and evaluate them efficiently using Keras. This part of
the book includes the following lessons:
Crash Course In Multilayer Perceptrons.
Develop Your First Neural Network With Keras.
Evaluate The Performance of Deep Learning Models.
Use Keras Models With Scikit-Learn For General Machine Learning.
These important lessons are tied together with three foundation projects. These projects
demonstrate how you can quickly and efficiently develop neural network models for tabular
data and provide project templates that you can use on your own regression and classification
machine learning problems. These projects include:
Project: Multiclass Classification Problem.
Project: Binary Classification Problem.
Project: Regression Problem.
At the end of this part you will be ready to discover the finer points of deep learning using
the Keras API.
1.3. Book Organization 5

1.3.4 Part 4: Advanced Multilayer Perceptrons


In this part you will learn about some of the more finer points of the Keras library and API for
practical machine learning projects and some of the more important developments in applied
neural networks that you need to know in order to deliver world class results. This part of the
book includes the following lessons:

Save Your Models For Later With Network Serialization.

Keep The Best Models During Training With Checkpointing.

Understand Model Behavior During Training By Plotting History.

Reduce Overfitting With Dropout Regularization.

Lift Performance With Learning Rate Schedules.

At the end of this part you will know how to confidently wield Keras on your own machine
learning projects with a focus of the finer points of investigating model performance, persisting
models for later use and gaining lifts in performance over baseline models.

1.3.5 Part 5: Convolutional Neural Networks


In this part you will receive a crash course in the dominant model for computer vision machine
learning problems and some natural language problems and how you can best exploit the
capabilities of the Keras API for your own projects. This part of the book includes the following
lessons:

Crash Course In Convolutional Neural Networks.

Improve Model Performance With Image Augmentation.

The best way to learn about this impressive type of neural network model is to apply it.
You will work through three larger projects and apply CNN to image data for object recognition
and text data for sentiment classification.

Project: Handwritten Digit Recognition.

Project: Object Recognition in Photographs.

Project: Movie Review Sentiment Classification.

After completing the lessons and projects in this part you will have the skills and the
confidence of complete and working templates and recipes to tackle your own deep learning
projects using convolutional neural networks.
1.4. Requirements For This Book 6

1.3.6 Part 6: Recurrent Neural Networks


In this part you will receive a crash course in the dominant model for data with a sequence or
time component and how you can best exploit the capabilities of the Keras API for your own
projects. This part of the book includes the following lessons:

Crash Course In Recurrent Neural Networks.

Multilayer Perceptron Models for Time Series Problems.

LSTM Models for Time Series Problems.

Understanding State in LSTM Models for Sequence Prediction.

The best way to learn about this complex type of neural network model is to apply it.
You will work through two larger projects and apply RNN to sequence classification and text
generation.

Project: Sequence Classification of Movie Reviews.

Project: Text Generation With Alice in Wonderland.

After completing the lessons and projects in this part you will have the skills and the
confidence of complete and working templates and recipes to tackle your own deep learning
projects using recurrent neural networks.

1.3.7 Conclusions
The book concludes with some resources that you can use to learn more information about a
specific topic or find help if you need it as you start to develop and evaluate your own deep
learning models.

1.3.8 Recipes
Building up a catalog of code recipes is an important part of your deep learning journey. Each
time you learn about a new technique or new problem type, you should write up a short code
recipe that demonstrates it. This will give you a starting point to use on your next deep learning
or machine learning project.
As part of this book you will receive a catalog of deep learning recipes. This includes recipes
for all of the lessons presented in this book, as well as the complete code for all of the projects.
You are strongly encouraged to add to and build upon this catalog of recipes as you expand
your use and knowledge of deep learning in Python.

1.4 Requirements For This Book


1.4.1 Python and SciPy
You do not need to be a Python expert, but it would be helpful if you knew how to install and
setup Python and SciPy. The lessons and projects assume that you have a Python and SciPy
1.5. Your Outcomes From Reading This Book 7

environment available. This may be on your workstation or laptop, it may be in a VM or a


Docker instance that you run, or it may be a server instance that you can configure in the cloud
as taught in Part II of this book.
Technical Requirements: The technical requirements for the code and tutorials in this
book are as follows:

Python version 2 or 3 installed. This book was developed using Python version 2.7.11.

SciPy and NumPy installed. This book was developed with SciPy version 0.17.0 and
NumPy version 1.11.0.

Matplotlib installed. This book was developed with Matplotlib version 1.5.1.

Pandas installed. This book was developed with Pandas version 0.18.0.

scikit-learn installed. This book was developed with scikit-learn 0.17.1.

You do not need to match the version exactly, but if you are having problems running a
specific code example, please ensure that you update to the same or higher version as the library
specified. You will be guided as to how to install the deep learning libraries Theano, TensorFlow
and Keras in Part II of the book.

1.4.2 Machine Learning


You do not need to be a machine learning expert, but it would be helpful if you knew how to
navigate a small machine learning problem using scikit-learn. Basic concepts like cross validation
and one hot encoding used in lessons and projects are described, but only briefly. There are
resources to go into these topics in more detail at the end of the book, but some knowledge of
these areas might make things easier for you.

1.4.3 Deep Learning


You do not need to know the math and theory of deep learning algorithms, but it would be
helpful to have some basic idea of the field. You will get a crash course in neural network
terminology and models, but we will not go into much detail. Again, there will be resources for
more information at the end of the book, but it might be helpful if you can start with some
idea about neural networks.
Note: All tutorials can be completed on standard workstation hardware with a CPU. A
GPU is not required. Some tutorials later in the book can be sped up significantly by running
on the GPU and a suggestion is provided to consider using GPU hardware at the beginning of
those sections. You can access GPU hardware easily and cheaply in the cloud and a step-by-step
procedure is taught on how to do this in Chapter 5.

1.5 Your Outcomes From Reading This Book


This book will lead you from being a developer who is interested in deep learning with Python
to a developer who has the resources and capabilities to work through a new dataset end-to-end
using Python and develop accurate deep learning models. Specifically, you will know:
1.6. What This Book is Not 8

How to develop and evaluate neural network models end-to-end.

How to use more advanced techniques required for developing state-of-the-art deep learning
models.

How to build larger models for image and text data.

How to use advanced image augmentation techniques in order to lift model performance.

How to get help with deep learning in Python.

From here you can start to dive into the specifics of the functions, techniques and algorithms
used with the goal of learning how to use them better in order to deliver more accurate predictive
models, more reliably in less time. There are a few ways you can read this book. You can dip
into the lessons and projects as your need or interests motivate you. Alternatively, you can
work through the book end-to-end and take advantage of how the lessons and projects build in
complexity and range. I recommend the latter approach.
To get the very most from this book, I recommend taking each lesson and project and build
upon them. Attempt to improve the results, apply the method to a similar but di↵erent problem,
and so on. Write up what you tried or learned and share it on your blog, social media or send
me an email at jason@MachineLearningMastery.com. This book is really what you make of it
and by putting in a little extra, you can quickly become a true force in applied deep learning.

1.6 What This Book is Not


This book solves a specific problem of getting you, a developer, up to speed applying deep
learning to your own machine learning projects in Python. As such, this book was not intended
to be everything to everyone and it is very important to calibrate your expectations. Specifically:

This is not a deep learning textbook. We will not be getting into the basic theory
of artificial neural networks or deep learning algorithms. You are also expected to have
some familiarity with machine learning basics, or be able to pick them up yourself.

This is not an algorithm book. We will not be working through the details of how
specific deep learning algorithms work. You are expected to have some basic knowledge of
deep learning algorithms or how to pick up this knowledge yourself.

This is not a Python programming book. We will not be spending a lot of time on
Python syntax and programming (e.g. basic programming tasks in Python). You are
expected to already be familiar with Python or a developer who can pick up a new C-like
language relatively quickly.

You can still get a lot out of this book if you are weak in one or two of these areas, but you
may struggle picking up the language or require some more explanation of the techniques. If
this is the case, see the Getting More Help chapter at the end of the book and seek out a good
companion reference text.
1.7. Summary 9

1.7 Summary
It is a special time right now. The tools for applied deep learning have never been so good.
The pace of change with neural networks and deep learning feels like it has never been so fast,
spurred by the amazing results that the methods are showing in such a broad range of fields.
This is the start of your journey into deep learning and I am excited for you. Take your time,
have fun and I’m so excited to see where you can take this amazing new technology.

1.7.1 Next
Let’s dive in. Next up is Part II where you will take a whirlwind tour of the foundation libraries
for deep learning in Python, namely the numerical libraries Theano and TensorFlow and the
library you will be using throughout this book called Keras.
Part II

Background

10
Visit https://ebooknice.com to
discover a wide range of
eBooks across various genres.
Enjoy exclusive deals and
discounts to enhance your
reading experience. Start your
digital reading journey today!
Chapter 2

Introduction to Theano

Theano is a Python library for fast numerical computation that can be run on the CPU or GPU.
It is a key foundational library for deep learning in Python that you can use directly to create
deep learning models. After completing this lesson, you will know:

About the Theano library for Python.

How a very simple symbolic expression can be defined, compiled and calculated.

Where you can learn more about Theano.

Let’s get started.

2.1 What is Theano?


Theano is an open source project released under the BSD license and was developed by the LISA
(now MILA1 ) group at the University of Montreal, Quebec, Canada (home of Yoshua Bengio).
It is named after a Greek mathematician. At it’s heart Theano is a compiler for mathematical
expressions in Python. It knows how to take your structures and turn them into very efficient
code that uses NumPy, efficient native libraries like BLAS and native code to run as fast as
possible on CPUs or GPUs.
It uses a host of clever code optimizations to squeeze as much performance as possible from
your hardware. If you are into the nitty-gritty of mathematical optimizations in code, check out
this interesting list2 . The actual syntax of Theano expressions is symbolic, which can be o↵
putting to beginners. Specifically, expression are defined in the abstract sense, compiled and
later actually used to make calculations.
Theano was specifically designed to handle the types of computation required for large
neural network algorithms used in deep learning. It was one of the first libraries of its kind
(development started in 2007) and is considered an industry standard for deep learning research
and development.
1
http://mila.umontreal.ca/
2
http://deeplearning.net/software/theano/optimizations.html#optimizations

11
2.2. How to Install Theano 12

2.2 How to Install Theano


Theano provides extensive installation instructions for the major operating systems: Windows,
OS X and Linux. Read the Installing Theano guide for your platform3 . Theano assumes a
working Python 2 or Python 3 environment with SciPy. There are ways to make the installation
easier, such as using Anaconda4 to quickly setup Python and SciPy on your machine as well
as using Docker images. With a working Python and SciPy environment, it is relatively
straightforward to install Theano using pip, for example:
sudo pip install Theano

Listing 2.1: Install Theano with pip.


New releases of Theano may be announced and you will want to update to get any bug fixes
and efficiency improvements. You can upgrade Theano using pip as follows:
sudo pip install --upgrade --no-deps theano

Listing 2.2: Upgrade Theano with pip.


You may want to use the bleeding edge version of Theano checked directly out of GitHub.
This may be required for some wrapper libraries that make use of bleeding edge API changes.
You can install Theano directly from a GitHub checkout as follows:
sudo pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git

Listing 2.3: Upgrade Theano with pip from GitHub.


You are now ready to run Theano on your CPU, which is just fine for the development of
small models. Large models may run slowly on the CPU. If you have a Nvidia GPU, you may
want to look into configuring Theano to use your GPU. There is a wealth of documentation of
the Theano homepage for further configuring the library.

Theano v0.8.2is the latest at the time of writing and is used in this book.

2.3 Simple Theano Example


In this section we demonstrate a simple Python script that gives you a flavor of Theano. In this
example we define two symbolic floating point variables a and b. We define an expression that
uses these variables (c = a + b). We then compile this symbolic expression into a function using
Theano that we can use later. Finally, we use our compiled expression by plugging in some real
values and performing the calculation using efficient compiled Theano code under the covers.
# Example of Theano library
import theano
from theano import tensor
# declare two symbolic floating-point scalars
a = tensor.dscalar()
b = tensor.dscalar()
3
http://deeplearning.net/software/theano/install.html
4
https://www.continuum.io/downloads
2.4. Extensions and Wrappers for Theano 13

# create a simple symbolic expression


c = a + b
# convert the expression into a callable object that takes (a,b) and computes c
f = theano.function([a,b], c)
# bind 1.5 to a , 2.5 to b , and evaluate c
result = f(1.5, 2.5)
print(result)

Listing 2.4: Example of Symbolic Arithmetic with Theano.


Running the example prints the output 4, which matches our expectation that 1.5 + 2.5 = 4.0.
This is a useful example as it gives you a flavor for how a symbolic expression can be defined,
compiled and used. Although we have only performed a basic introduction of adding 2 and 2,
you can see how pre-defining computation to be compiled for efficiency may be scaled up to
large vector and matrix operations required for deep learning.

2.4 Extensions and Wrappers for Theano


If you are new to deep learning you do not have to use Theano directly. In fact, you are highly
encouraged to use one of many popular Python projects that make Theano a lot easier to use
for deep learning. These projects provide data structures and behaviors in Python, specifically
designed to quickly and reliably create deep learning models whilst ensuring that fast and
efficient models are created and executed by Theano under the covers. The amount of Theano
syntax exposed by the libraries varies.
Keras is a wrapper library that hides Theano completely and provides a very simple API to
work with to create deep learning models. It hides Theano so well, that it can in fact run as a
wrapper for another popular foundation framework called TensorFlow (discussed next).

2.5 More Theano Resources


Looking for some more resources on Theano? Take a look at some of the following.

Theano Official Homepage


http://deeplearning.net/software/theano/

Theano GitHub Repository


https://github.com/Theano/Theano/

Theano: A CPU and GPU Math Compiler in Python (2010)


http://www.iro.umontreal.ca/~lisa/pointeurs/theano_scipy2010.pdf

List of Libraries Built on Theano


https://github.com/Theano/Theano/wiki/Related-projects

List of Theano configuration options


http://deeplearning.net/software/theano/library/config.html
2.6. Summary 14

2.6 Summary
In this lesson you discovered the Theano Python library for efficient numerical computation.
You learned:

Theano is a foundation library used for deep learning research and development.

Deep learning models can be developed directly in Theano if desired.

The development and evaluation of deep learning models is easier with wrapper libraries
like Keras.

2.6.1 Next
You now know about the Theano library for numerical computation in Python. In the next
lesson you will discover the TensorFlow library released by Google that attempts to o↵er the
same capabilities.
Another Random Document on
Scribd Without Any Related Topics
legeltesse, most naponkint még többször járt oda, de csak könyűket
folyasztani, s azon gondolat által, hogy azt, a mi neki oly igen
tetszett, meg nem látja többé, s hogy egyszersmind a világon
legdrágább kincsét elvesztette – magát a bánatba minél mélyebben
sülyeszsze el. Azon nap, melyen Aladdin palotája régi helyére ismét
visszaállittatott, alig pirult a hajnal, s im a szultán már az erkélybe
ment. Komor tünődésbe merűlt lélekkel lépett ő be, s szemeit
szomoruan vetette azon táj felé, hol csak puszta tért, de nem palotát
vélt láthatni többé. És igy, midőn egyszerre e puszta helyett ismét
betöltve látta, azt a köd ámitó játékának hitte. Nagyobb figyelemmel
nézte mindinkább, és végre teljesen meggyőződött, hogy az –
Aladdin palotája. Öröm és vidor kedv váltá fel itt lelkének nehéz
boruját. Sietve tért szobájába vissza, parancsolván, hogy egyik lova
nyeregkészületben vezettessék elő. A lovat elővezeték, ő felűle, s
elindult. Lovagjártában ugy tetszett neki, hogy ménjének ónlába van,
s Aladdin palotája a világ vége.
Aladdint, ki előre látta azt, a mi történhetik, hajnalhasadtán
felkelt, és minekutána egyik leggazdagabb köntösét magára vette,
felment a huszonnégy ablaku terembe, honnan a szultánt érkezni
látta. Lesietett, s még épen jókor jöve, hogy őt a főlépcsőn
elfogadja, és lováról lesegitse. „Aladdin – monda a szultán – én
veled egy szót sem szólhatok, mielőtt leányomat láttam s öleltem.“
Aladdin a szultánt Badrulbudur herczegné szobái felé vezette, és ez,
kit fölkeltekor Aladdin arra emlékeztetett, hogy többé nem Afrikában,
hanem Chinában és ugyan atyjának fővárosában, közel palotájához,
vagyon, épen elvégezte öltözetét. A szultán többször megölelé,
arczát az öröm könyüi áztaták, és a herczegné részéről, minden
lehető jeleit adá az örömnek, melyet viszonlátásán éreze.
A szultánt az érzékeny megindulás jó ideig szólni nem engedé,
hogy szeretett leányát, kit oly sokáig mint halál áldozatját siratott,
viszont megtalálta; s a herczegné szintazon mód örömkönyüket
hullatott, hogy atyját, a szultánt, viszontláthatta.
Végre a szultán igy kezdé beszédjét: „Kedves leányom! azt kell
gondolnom, hogy a viszontlátás öröme okozza, hogy rajtad oly kevés
változást veszek észre, mintha legkisebb kellemetlenség sem zavarta
volna meg éltedet; és még is meg vagyok győződve, hogy sokat,
sokat kelle szenvedned. Egy egész palotát, s benne téged
elragadtatva képzelni alig lehet a nélkül, hogy nagy nyugtalanság s
aggodalom ne legyen mellette. Beszélj el nekem mindent, és ne
titkolj el semmit.“ A herczegné örömének tartá a szultánnak,
atyjának, akaratját teljesiteni s monda: „Ha rajtam, atyám és Felség!
oly kevés változást tapasztalsz: kérlek, fontold meg, hogy én még
tegnap korán reggel feléledtem drága férjem és szabaditóm Aladdin
megérkezése által, a kit már reám nézve elveszettnek gondoltam és
mint olyat sirattam; és hogy a téged ölelésnek szerencséje engem
visszahelyez egészen egykori boldog sorsomba. Hogy nyilván
kimondjam, egész szenvedésem abban állott, hogy magamat
felségedtől, s kedves férjemtől elszakasztva láttam, és pedig nem
csupán férjemhez viseltető szerelmem tekintetéből, hanem azon való
aggodalmamnál fogva is, hogy Felséged gerjedékeny természetét
ismervén, őt mint ártatlant bár, feláldozottnak képzeltem.
Kevesebbet kellett rablóm szemtelensége végett kiállanom, ki oly
szavakat ejtett hozzám, melyek nekem épen nem tetszhettek, de
azon felsőbbség által, melyet magamnak rajta szerezni tudtam,
könnyű volt azoknak határt vetnem. Egyébiránt bármi kényszeritést
is szintoly kevéssé tapasztaltam, valamint most. A mi pedig illeti
elragadtatásomat, abban Aladdinnak legkisebb része sincs, hanem
oka, bár ártatlan is, egyedül én vagyok.“
Hogy beszéde igazságáról a szultánt meggyőzhesse, elmondá
továbbá körülményesen, mikép vevé az afrikai bűbájos egy
lámpaárus alakját magára, és mikép kinála uj lámpákat ócskákért
cserében, és ő mint adta csupán kedvtöltésűl Aladdin lámpáját,
melynek titkos erejét és fontos voltát nem ismerte, egy ujért oda;
továbbá mikép emeltetett fel, s vitetett Afrikába által e csere után ő
és palotája, az afrikai bűbájossal együtt, kit két rabnője, s a lámpát
becserélő herélt nyomban megismertek, mihelyt czélzatának
szerencsés sikerülte után magát legelőbb is bemutatni, s kezét kérni,
bátorkodott. Végre minő kisértéseket kelle Aladdin elérkeztéig türnie,
micsoda eszközökhez nyultak együtt, hogy a bűbájostól a lámpát,
melyet az szüntelen magánál hordozott, visszakeritsék; mikép
boldogultak ebben – magokattettetvén, s őt vacsorára szobájokba
hiván, s ugy a többiti egész a méregpohárig, melylyel a herczegné őt
megkinálá. A többire nézve, – ugymond – férjemre bizom, hogy azt
Felségednek elbeszélje.
Aladdin ezekhez csak keveset adhatott. „A mint előttem – igy
folytatá a rejtekajtó megnyittatott, s én a huszonnégyablaku
terembe feljutván, az árulót, a por hatalmas ereje által a pamlagon
odahalva találtam, kértem a herczegnét, kihez a további jelen
maradás nem illetett, hogy asszonyaival s herélteivel együtt szobáiba
vonulna vissza. Csak magam maradtam tehát, kihuzván a bűbájos
kebléből a lámpát, annak szintazon titkos erejét használtam, melylyel
előbb a bűbájos élt vala, midőn e palotát a herczegnével együtt
elragadá. Igy vittem véghez, hogy a palota ismét előbbi helyén áll, s
szerencsém lőn Felséged parancsolatja szerént a herczegasszonyt is
visszahozni. Egyébiránt a történt dolgot hiven beszéltem el, s ha
Felséged nem tartja terhének, a terembe felmenni, önszemeivel
fogja látni, mikép nyerte el a bűbájos méltó büntetését.“
A szultán, hogy az igazságról teljesen meggyőződjék, felkelt, s a
terembe felment, és a mint itt az afrikai bűbájost halva, s képében a
méregportól fekete-kékülten találta, megölelé Aladdint igen
érzékenyen s igy szóla hozzá: „Fiam, ne vedd rosz néven azon
bánást, melyet irántad mutattam, atyai szeretetem kénytetett arra;
én valóban megérdemlem, hogy ezen hirtelenkedést, melyre magam
elragadtatni hagyám, megbocsásd.“ „Uram, felele Aladdin, legkisebb
okom sincs, Felséged bánása ellen panaszkodni. Felséged csak azt
tevé, a mit tenni tartozott. E bűbájos a gyalázatos, és semmirekellő
– volt egyedűl oka, hogy Felséged kegyelmét elvesztém. Ha egykor
Felségednek ideje leend, elbeszélem egy más galád csinjét ellenem,
mely lelkét szintoly feketének vallja, mint az, melytől most istennek
különös kegyelme megmentett.“ „Én magam – válaszolt a szultán –
jegyzek ki erre neked egy bizonyos órát, és pedig minél előbb. De
most ne legyen egyébre gondunk, hanem, hogy megpihenjünk; ezt a
gyülölt tárgyat pedig takarittasd el.“
Aladdin az afrikai bűbájos tetemeit elviteté, parancsolá, hogy a
vesztő helyen a vadaknak vessék martalékul. A szultán azalatt
parancsát adá, hogy dobok, trombiták és más hangszerek játékával
egy közös örömünnep kezdődjék, mely Badrulbudur herczegné és
Aladdin szerencsés visszajövetének emlékezetére tiz napig tartson.
Igy menekedett Aladdin másodszor egy őt környékező halálos
veszedelemből; de még ez sem volt utolsó, hanem még egy
harmadik is fenyegeté, melyet itt körülményesen elbeszélünk.
Az afrikai varázslónak vala egy ifjabb testvére is, ki a varázslatban
nem kevésbbé, mint bátyja, volt jártas, sőt azt lehet mondani, hogy
gonoszságával és kártékony ármányaival őt még felűl multa. Mivel
nem mindenkor együtt s azon egy városban laktak, és az egyik
gyakorta napkeleten, a másik napnyugoton tartózkodott, tehát nem
mulaszták el a pontozás mesterségének segedelmével évenkint
kitanulni, mindegyik a világ melyik részében él, minők körülményeik,
és nincs-e egymás segedelmére szükségök.
Kevés időre azután, midőn az afrikai varázsló Aladdin szerencséje
ellen törtében halálát lelé, ifjabb testvére, ki már egy esztendőn túl
bátyjáról semmit sem hallott és nem Afrikában, hanem egy igen
távol tartományban lakott, tudni kivánta, a földnek melyik részén él
amaz, mint van dolga és mit mivel. Akárhova ment, szinte miként
bátyja, magával vivé a pontozás négyszögét, ezt most elővette,
elrendezé, pontjait kijegyzé, képeket és vonalakat vont, s születését
állatá.
Midőn mind ezen képeket átfutá, ugy találta, hogy bátyja nincs a
világon többé, hanem hogy hirtelen méreghalállal kimult, és ugyan
Chinának fővárosában, ezen és ezen a helyen. És hogy gyilkosa egy
pór származásu ember, ki a szultán herczegleányát házastársul vevé.
Midőn a bűbájos ily módon bátyjának szomoru sorsát kitudta,
nem veszte időt hasztalan szánakozással; hanem nyomban eltökélé,
annak halálát megboszulni, lóra ült s Chinába vette utját. Utaztában
jó tova sik térségeken, folyókon, hegyeken és pusztákon ment
keresztűl a nélkül, hogy valahol késnék, és igy jött végre szertelen
bajok s akadályok között Chinába és ezen tartomány fővárosába.
Bizonyos lévén, hogy nem csalódott, hogy ezen tartományt nem egy
másikkal cserélte fel, e fővárosban megállapodott és szállást vőn.
A varázsló eljövete után más napra kiment, és midőn a városban
szertesétálna, koránsem annak szépségeit, melyek nem érdeklék,
látni, hanem veszedelmes czéljának műeszközeit elrendezni –
befordult minden nyilvános helyekre, hol sok ember volt, és élénken
figyelt mindenre, a mit ott beszéltek. Egy ilyetén helyen, hol az időt
mindenféle játékkal volt szokás tölteni, és a hol mig az egyik rész
játszott, a másik ujsággal s napi történetekkel mulatá magát,
különös csudadolgokat hallott beszélni egy világtól elkülönözött
erkölcsös jámbor asszonyról, kinek neve Fatime volt. Gondolván,
hogy ezen asszony majd valamiben szándékát segedelmezheti, egyet
a társaságból félrehitt és kérte, mondana neki valami körülményest e
szent asszonyról s azon csudákról, melyeket tesz.
„Hogyan? – válaszolt a férfiu – te ezen asszonyt még soha sem
láttad, sem beszélni róla nem hallottál? Ő bőjtölése, szigoru élete és
jó példája által a városban közcsudálat tárgya. Hétfőn és pénteken
kivül soha sem jő ki kisded magányából, és a mely napokon a
városban mutatja magát, számtalan jókat tesz, és minden
főfájdalomban szenvedőt kezével illetvén, meggyógyit.“
A varázsló többet nem kivánt tudni, csak azt tudakozta még a
vendég-férfiutól, a városnak mely részén fekszik e szent asszonynak
remetelakása. A férfiu leirta neki a helyet. Minekutána e
tudósitásokat vette s a galád csintervet, melyről nem sokára szólani
fogunk, kidolgozá, mindjárt másnap, melyen a szent asszony kiment,
valamennyi lépéseit megleste, mignem estve őt magányába
visszatérni látta. Midőn a helyet magának jól feljegyezte, elment a
már érintett helyek egyikébe, hol bizonyos meleg itallal szoktak
szolgálni, és hol egész éjszakákat lehetett tölteni, ha a jó kedv úgy
akarta, kivált nagy hőségben, hol az ember e tartományban inkább
pokróczon mint ágyban alszik.
Minekutána a varázsló a fogadósnak ama kevésért, a mit
magának adatott, megfizetett volna, éjfélkor eltávozott, egyenesen a
szent Fatime asszony remetelakjához – ezen nevezet alatt ismérte t.
i. kiki őt a városban. Megnyitá igen könnyeden az ajtót, mert csupán
kilincszára volt. Midőn oda belépett s az ajtót igen csendesen viszont
betette, látta Fatimét tiszta holdvilágnál egy nyugvón aludni, mely
silány daróczczal vala betakarva. A varázsló közelite hozzá, és tőrt
vont ki, melyet oldalán viselt, s fölkelté őt.
Midőn a szegény Fatime fölemelte szemeit, nem kevéssé ijedt
meg, látván egy férfiut, ki őt meggyilkolni készüle. A varázsló a tőrt
keblének tartá, igy szólván hozzája: „Ha kiáltasz, vagy legkisebb zajt
inditsz, oda életed; kelj fel, és cselekedd, a mit mondok.“
Fatime, ki öltözötten aludt, az ijedelem miatt reszketve kelt fel.
„Ne félj, – monda a varázsló – én csupán ruhádat akarom, add azt
ide, s vedd érte az enyimet.“ Kicserélék itt ruháikat, és minekutána a
varázsló Fatime ruháját magára vevé, igy szólott hozzá: „Most fesd
be arczomat a tied szerint, ugy hogy hozzád hasonlónak láttassam, a
festék pedig az arczon ne változzék.“ A varázsló őt még folyvást
reszketni látta, hogy tehát megnyugtassa, s rábirhassa, annak a mit
tőle kivánt, nagyobb bizodalommal teljesitésére, monda neki: „Ne
félj, ujra mondom; esküszöm neked Istenre, hogy nem bántom
életedet.“ Fatime őt beereszté kamrájába, lámpáját meggyujtá,
ecsetet vőn s egy bizonyos nedvvel, melyet egy kis edényben tarta,
bekené arczát, s bizonyossá tevé, hogy amaz állandó, s arcza
legkisebb különbség nélkül az övéhez leend hasonló. Ezután saját
asszonyi fövegét tette fejére – egy fátyollal együtt, s megtanitá,
azzal arczát a városon jártában mint födözze el; végre, midőn egy
nagy olvasót, mely elől egész övig nyult, akasztott volna nyakába,
tulajdon botját, melylyel közönségesen kijárt, adá kezébe, s tükröt
tartván elébe, igy szólott: „Tekints be, s lásd, hogy tökéletes másom
vagy.“ A varázsló mindent ugy lele, mint kivánta, de esküvését,
melyet a jó Fatimének oly ünnepileg tőn, nem tartá meg. Félvén a
vérjelektől, agyon ugyan őt nem szurta, de megfojtotta, és midőn
látta, hogy kiadá lelkét, holttestét lábainál fogva a remetelak
kutjához hurczolta, s bevetette.
A szent Fatimévé átalakult varázsló e galád gyilkosság után az éj
maradékrészét a remetelakban tölté el. Másnap reggel vagy hét
órakor, noha épen e napon a szent asszony kijárni nem szokott, a
városba ment, meggyőződvén, hogy e végett senki őt kérdezni nem
fogja, s ha valaki kérdezné is, fog reá felelhetni. Mivel a városba
érkeztével mindenek előtt Aladdin palotáját már kitudakozta, s azt
előlegesen megnézte, és mivel rémczélzati azon helyen valának
kiviendők, egyenesen oda vevé utját.
Mihelyt a varázló a szent asszony alakjában magát az utczán
mutatta, azonnal számos nép vevé körül. Ezek itt könyörgéseibe
ajánlák magokat, amazok kezeit csókolták, mások mint okosabbak
csupán ruhája szegetét; s ismét mások, kik főfájásban szenvedtek,
vagy attól csupán mentek maradni kivántak, meghajlának előtte,
hogy kezeit fejökre tartaná, a mit a varázsló meg is tett – közben
néhány szót imádság gyanánt dörmögvén; – szóval: ő a szent
asszonyt oly hiven utánozta, hogy mindenki őt a jámbor Fatimének
gondolá. Minekutána utjában többször megállapodott volna, hogy az
emberek kivánatit kielégitse, kiknek az ily kézilletés sem ártott sem
használt, eljött végre azon piaczra, melyen Aladdin palotája állott. Itt
oly nagy volt az összetódulás, hogy csak bajjal lehetett egyesnek
hozzá közelitni. Az erősök és tüzeskedők erőszakkal törtek a
sokaságon keresztül, a mire oly hangos panaszok támadtak, hogy a
zaj még a huszonnégyablaku terembe is, melyben Badrulbudur
herczegné vala, elhallatszott.
A herczegné kérdezé, mi zajgás az; és mivel senki sem
mondhatta meg, parancsolá, hogy valaki nézné meg, és hozzon hirt.
Rabnői közül egyik, a nélkül, hogy elhagyná a termet, egy
rostélyablakon kitekintett, s jelenté azután, hogy a zaj a
népsokaságtól ered, mely a szent asszonyt körülveszi, ki kézilletéssel
gyógyit minden főfájdalmat.
A herczegné, ki a szent asszonyról már igen sok jót hallott, de őt
még soha sem látta, kiváncsi lőn őt látni és vele beszélni. Mihelyt ez
iránt kedvét sejteté, a heréltek feje, ki épen jelen volt, igy szólott
hozzá: „Herczegné, ha kedved tartja, örömmel hivatom elődbe –
csak parancsolnod kell.“ A herczegné elfogadá ajánlását, és a
heréltek feje tüstént külde négy heréltet azon parancscsal, hogy az
álszentet kisérjék fel.
Mihelyt a nép a herélteket kilépni látá a palotából, s a burkolt
varázsló felé menni, azonnal visszavonult; és midőn a varázsló most
magát szabadnak, s a négy heréltet feléje jönni látta, vidám arczával
méne elejökbe, – mert sejté, hogy ámitásai kivánt folyamatban
vannak. A heréltek egyike igy szólott hozzá: „Szent asszony! a
herczegné téged látni óhajt, jer, és kövess minket.“ „A herczegné
igen kegyelmes – felelt az ál Fatime – legyen meg, a mint
parancsolja.“ Ezt mondván, követé a herélteket, kik már a palota felé
visszaindultak.
Midőn a varázsló, ki a jámborság köntöse alatt ördögi szivet
takart, a huszonnégyablaku terembe lépett, s a herczegnét meglátta,
imádságot kezdett, melyben az Istentől a herczegnének szerencsét,
áldást, minden kivánatira sikerülést kért. Azután csábitó,
jámborármányos beszédességét kezdé használni, hogy az
istennesség palástja alatt a herczegasszonynál magát beszinezze. Ezt
elérte igen könnyen; mert a herczegné szelid természetű, jó szivű
volt, s azt vélé, hogy mindenki ugy gondolkodik, ugy érez, miként ő;
leginkább pedig azoktól nem gyanithatott roszat, kik a világtól
elvonulva látszottak Istennek szolgálni.
Végezvén az ál-Fatime hosszu beszédét, igy szólott hozzá a
herczegné: „Köszönöm, jó anyám, szép imádságidat, bizom és
reménylem, hogy Isten azokat meg fogja hallgatni. Lépj közelebb, és
ülj le mellém.“ Az ál-Fatime leüle tettetett alázattal, s a herczegné
ujra igy szólott: „Jó anyám, én valamit kérek tőled, de meg ne
tagadd. Maradj nálam, beszéld el nekem életed folyását, s jó példáid
által tanits meg, mint szolgáljak hiven Istenemnek.“
„Herczegné – válaszolt erre a kendőzött Fatime – kérlek, ne
kivánd tőlem, a mit nem teljesithetek, a nélkül, hogy imádságomat s
istenes gyakorlásaimat elmulaszszam.“ „Ez ne busitson, – felele a
herczegné – nekem elég üres szobám van, válaszd ki magadnak azt,
mely leginkább tetszik, s melyben istenes gyakorlásidat szintugy
mint remetelakodban békével végezhesd.“
A varázsló nem sok ellenvetést tőn a herczegné szives
ajánlásaira; főczélja csak az volt, hogy Aladdin palotájába magános
szabad bejárást szerezzen, azt most elnyeré kedvezőbb szerencsével,
mert magában a palotában lakhatott, a herczegné kegyelme és
oltalma alatt ördögi csinját igy könnyebben viheté véghez, mint ha a
remetelakból a palotába, s innen viszont oda kellett volna szüntelen
mennie. „Herczegné – igy szóla alázattal a galád – bármint tökélje is
magában el egy szegény nyomoru asszony, mint én vagyok, hogy a
világról, annak fényéről és pompájáról lemond; egy jámbor kegyes
herczegnének szavai nagy erővel birnak; én kivánatának,
parancsának nem állhatok ellent.“
A varázslónak ezen szavaira a herczegné felkele és mondá neki:
„Kelj fel és jer velem, megmutatom neked üres szobáimat: válaszsz
azokból kedved szerint.“ Ő követé Badrulbudur herczegnét, és
valamennyi tiszta és ékes szobák közül azt választá, mely
legegyszerűbb vala; mondván ekkor is a képmutató, hogy szemeinek
nehéz leend csak ennek is fényéhez szoknia, ámde a herczegné
kedvéért kész ez áldozatra.
A herczegné az ámitót a huszonnégyablakú terembe akará
visszavezetni s ebéden magánál tartani; de mivel a galád tudta, hogy
asztalnál a fátyolt arczáról félre kell emelnie, és félt, hogy a
herczegné megismeri, hogy ő nem a szent Fatime asszony – váltig
lemondólag köszönte a kegyelmet. „Én – ugymond – csak kenyérrel
és száraz gyümölcscsel élek, paloták csemegéihez nem szoktam,
engedd, hogy kisded ebédemet saját szobámban egyem meg.“ „Jó
anyám – felele kérésének engedőleg a herczegné – te szabad vagy,
cselekedjél, mint remetelakodban szoktál; én magam viszem el
étkedet; azonban ne felejtsd el, hogy ebéd után hozzám
visszavárlak.“
A herczegné ebédhez ült, s az ál Fatime, mihelyt egy herélttől
megérté, hogy felkelt az asztaltól, azonnal jött. „Jó anyám – monda
a herczegné – örvendek, hogy ily szent életű asszonyt nyertem
magamhoz, ő áldást fog hozni ezen palotára. De ugyan valld meg,
mint tetszik neked e palota? Azonban, mig azt neked szobáról
szobára megmutatnám, mondd meg, mit itélsz ezen teremről?“
Az ál Fatime, ki eddig folyvást hajtott fővel állott és azt sem
jobbra sem balra nem forgatá, most más alakjátékot kezdett, – fejét
a kérdésre fölemelte, átfutá szemeivel a termet egy végétől a
másikáig – és minekutána elégletig vizsgálta, mondá: „Herczegné, e
terem valóban álmélatig szép; – mindazáltal engedj meg, ha mint
remeteasszony, ki a világi müvek fényét nem tudja itélni, azt
mondom; hogy e terem egy dolognak hijával van.“ „Ugyan mi lehet
az, jó anyám? – kérdezé a herczegné. – Mondd meg azt nekem,
kérlek. Én részemről mindig azt vélem s másoktól is ugy hallottam,
hogy semminek sincs hijával. De ha felfedezed a hiányt, segitek
rajta.“
„Herczegné – válaszolt az ál Fatime nagy tettetéssel – bocsásd
meg, hogy oly bátor vagyok. Én ugy vélném – ha még előtted
véleményemnek van helye, hogy ha fölül e kupüreg közepéről egy
roktojás függne alá, ezen teremnek a földön nem volna mása, s e
palota a világnak csudájává lenne.“
„Jó anyám – kérdezé a herczegné – micsoda madár az a rok? és
hol lehetne annak tojását megszerezni?“ „Herczegné – válaszolt az ál
Fatime – ez egy szörnyű nagy madár, mely a Kaukazus hegyének
legfőbb csucsán lakik. A ki palotádat épitette, az ezt a tojást is meg
fogja szerezni.“
Badrulbudur herczegné az ál Fatimének ugyvélt jó tanácsát
megköszönte, s ezzel mulatásul beszédét más tárgyakra hajlitá;
hanem azért a roktojást eszében tartá, s feltevé magában, hogy

Ő
mihelyt haza tér Aladdin a vadászatról, erről neki emlitést tesz. Ő
tudniillik már hat nap óta távol volt, és a varázsló, ki ezt igen jól
tudta, használni akará jelennemlétét. Aladdin még az nap estve
visszajött, épen midőn az ál Fatime a herczegnétől elbucsuzott, és
szobájába tért. Ő felment herczegnéjének teremébe, a ki szinte
akkor tért oda vissza; Aladdin üdvözlé és megölelé őt, de ugy látszék
neki, mintha őt hidegebb szivvel fogadná. „Kedves herczegné! – igy
szólott hozzá – te ma nem vagy oly vidám és derült, mint máskor.
Talán távollétem alatt valami történt, a mi kedved ellen van, s neked
bajt és bántalmat szűlt? Fedezd föl azt nekem, én Istenre fogadom,
hogy mindent, a mi hatalmamban áll, elkövetek megnyugtatásodra.“
„Az csupán egy csekélység – felele a herczegné – és engem oly
kevessé aggaszt, hogy csudálkoznom kell, mint lehete arczomon a
kedvetlenség valami nyomát észrevenni. Mivel azonban várásom
ellen rajtam változást tapasztalsz, tehát okát nem titkolom el, ámbár
csak csekély érdekű. Valamint te, ugy én is mindig azt gondoltam, –
folytatá a herczegné, – hogy palotánk a legfölségesebb,
legragyogóbb és legtökéletesebb e világon. Azonban csak
megmondom, hogy a huszonnégyablaku teremnek szorosabb
megvizsgálása után mi jött eszembe. Nem gondolnád-e, hogy e
palota a tökély legfőbb csodapontját érné el, ha a kuptető közepéről
egy rok-tojás alá függne?“ „Herczegné – valaszola Aladdin – ha ugy
találod, hogy e csodaterem még egy roktojás hijával van, akkor elég,
hogy a hiányt magam is érezzem; és azon szorgalomból, melylyel e
fogyatkozást eltörlöm, meg fogsz győződhetni, hogy kedvedért
mindent megteszek.“
Aladdin a herczegnét tüstént elhagyta, felment a
huszonnégyablaku terembe, kihuzta kebléből a lámpát, melyet a
szenvedett szerencsétlenség óta mindenütt magával hordozott, s
dörzsölte azt. Azonnal itt termett a szellem. „Szellem! – igy szólt
Aladdin, – e kuptető még egy roktojás hiával van, melynek a
kupüreg közepéről kellene aláfüggni; én parancsolom neked most a
lámpa nevében, mely kezemben van, hogy e hiányt pótold ki.“
Alig mondá ki e szavakat Aladdin, – s a szellem oly nagy irtóztató
orditást tőn, hogy a terem rengett bele, hogy Aladdin tántorgott s
csak nem összeesett. „Mit, nyomoru! – monda a szellem oly hangon,
mely a legbátrabb szivű férfiut is megdöbbenthette; – tehát nem
elég neked, hogy én és társaim eddig mindenben kedvedet töltöttük,
azt parancsolod most te hálátlan, szörnyeteg, hogy neked saját
atyámat hozzám el, s e kupbolt közepén akaszszam fel? Ez a vad
gonoszság megérdemlené, hogy nyomban asszonyoddal és
palotáddal együtt porrá és hamuvá változzál; köszönd, hogy e
kivánság közvetlen nem tőled jő. Tudd meg; ezt az afrikai
varázslónak, ellenednek, ki általad méltólag elveszett, öcscse
parancsoltatja veled – ő palotádban tartózkodik, a szent Fatime
asszonynak, kit meggyilkolt, ruhájában jár burkolva, és ő az, ki
nődnek szivében ama kártékony kivánságot gerjeszté, melyet
ellenem kinyilatkoztattál. Szándéka, téged megölni; vigyázz tehát
magadra.“ Ezt mondván eltünt.
Aladdin a szellem minden szavára figyelt. Ő a szent Fatime
asszonyról már régen hallott beszélni, s tudta, mi módon gyógyitja
meg a fő fájdalmait. Visszaméne tehát a herczegné szobájába, s egy
szót sem szólván arról, a mi vele történt, leült, homlokát tenyerére
hajtá, s panaszkodott, hogy feje szörnyen fáj. A herczegné azonnal
parancsolá a szent asszonyt meghivni, és mig elhivák, elbeszélé
Aladdinnak, micsoda alkalommal jött légyen a palotába, és hogy
számára egy szobát adott lakásul.
Az alakos Fatime eljött. Mihelyt belépett, mondá hozzá Aladdin:
„Jőj ide, jó anyám, örvendek, hogy láthatlak, örülök, hogy épen most
jó szerencsémre itt vagy. Főfájás kapott meg, s alig tudom
szenvedni. Hallottam imádságod erejét, s azért kérlek, segits meg;
reménylem, hogy azon jótévőséget, melyet már annyi
főnyavalygóknak mutattál, tőlem sem fogod megtagadni.“ E
szavakkal felkelt, és lehajtá fejét. Az ál Fatime hozzájárula, de
kezével egy tőrt markolt, melyet a ruhája alatt viselt öv alá rejte.
Aladdin ki a varázsló minden mozdulatira vigyázott, hirtelen
megragadá ennek kezét, még minekelőtte a tőrt kihuzta volna,
keresztűl szurta szivét elülről, s a galádot a földre lesujtá.
„Kedves férjem, mit cselekedtél? – kiálta a herczegné
elszörnyedve. Te a szent asszonyt megölted!“ „Nem, kedves
herczegném, – felele Aladdin csendes lélekkel, – én nem Fatimét
öltem meg, hanem egy gazembert, a ki engem öl meg, ha meg nem
előzöm. E gazember, a kit itt látsz – folytatá szavait s a fátyolt
arczáról lerántja – meggyilkolta Fatimét is, s ruhájába öltözködött,
hogy engem kivégezzen; és hogy egészen ismerd – ő az afrikai
varázslónak, rablódnak testvére.“ Aladdin itt elbeszélé neki, mint
tudta meg ezen egyes körülményeket, s parancsolá azután, hogy a
holttestet félre takaritsák.
Igy szabadult meg Aladdin a két testvér varázsló üldözésétől.
Nehány évek multával megholt a szultán tisztes ősz korban.
Fiumaradéka nem lévén, Badrulbudur herczegné foglalá el mint
törvényes örökös a királyi széket, s uralkodását megosztá Aladdinnal.
Sok évekig uralkodtak együtt, s jeles derék utódokat hagyának
magok után.
Lábjegyzetek.
1) G u l e k , a mohamedánusok hite szerint valami boszorkány
vagy lélekformák; többnyire nőnemüek.
TARTALOM.
A fölébredt való története 1
Ganemnek, Abu Aibu fiának története 92
Harun Arresyd chalyf kalandjai 148
Aly Baba s a negyven haramia története 215
A varázs-ló 253
Aladdin, vagy a csodalámpa története 296
*** END OF THE PROJECT GUTENBERG EBOOK ARAB REGÉK (2.
KÖTET) ***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like