100% found this document useful (9 votes)
32 views

Neural Network Programming with Java Create and unleash the power of neural networks by implementing professional Java code 1st Edition Souza all chapter instant download

Neural

Uploaded by

riazimoodyff
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (9 votes)
32 views

Neural Network Programming with Java Create and unleash the power of neural networks by implementing professional Java code 1st Edition Souza all chapter instant download

Neural

Uploaded by

riazimoodyff
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Neural Network Programming with Java Create and


unleash the power of neural networks by
implementing professional Java code 1st Edition
Souza
https://textbookfull.com/product/neural-network-programming-
with-java-create-and-unleash-the-power-of-neural-networks-
by-implementing-professional-java-code-1st-edition-souza/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Artificial Neural Networks with Java - Tools for Building


Neural Network Applications 1st Edition Igor Livshin

https://textbookfull.com/product/artificial-neural-networks-with-java-
tools-for-building-neural-network-applications-1st-edition-igor-
livshin/
textboxfull.com

Learning Network Programming with Java 1st Edition Reese


Richard M

https://textbookfull.com/product/learning-network-programming-with-
java-1st-edition-reese-richard-m/

textboxfull.com

Java Network Programming Fourth Edition Harold Elliotte

https://textbookfull.com/product/java-network-programming-fourth-
edition-harold-elliotte/

textboxfull.com

Learning Java Beginning programming with java for dummies


First Edition John Bach

https://textbookfull.com/product/learning-java-beginning-programming-
with-java-for-dummies-first-edition-john-bach/

textboxfull.com
Learning Java An Introduction to Real World Programming
with Java Marc Loy

https://textbookfull.com/product/learning-java-an-introduction-to-
real-world-programming-with-java-marc-loy/

textboxfull.com

A Functional Approach to Java: Augmenting Object-Oriented


Java Code with Functional Principles 1st Edition Ben
Weidig
https://textbookfull.com/product/a-functional-approach-to-java-
augmenting-object-oriented-java-code-with-functional-principles-1st-
edition-ben-weidig/
textboxfull.com

Learning Java An Introduction to Real World Programming


with Java 5th Edition Marc Loy

https://textbookfull.com/product/learning-java-an-introduction-to-
real-world-programming-with-java-5th-edition-marc-loy/

textboxfull.com

Motivation Effort and the Neural Network Model Theodore


Wasserman

https://textbookfull.com/product/motivation-effort-and-the-neural-
network-model-theodore-wasserman/

textboxfull.com

Deep Learning with JavaScript: Neural networks in


TensorFlow.js 1st Edition Shanqing Cai

https://textbookfull.com/product/deep-learning-with-javascript-neural-
networks-in-tensorflow-js-1st-edition-shanqing-cai/

textboxfull.com
Neural Network Programming
with Java

Unleash the power of neural networks by implementing


professional Java code

Fábio M. Soares
Alan M.F. Souza

BIRMINGHAM - MUMBAI
Neural Network Programming with Java

Copyright © 2016 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the authors, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: January 2016

Production reference: 1060116

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham B3 2PB, UK.

ISBN 978-1-78588-090-2

www.packtpub.com
Credits

Authors Project Coordinator


Fábio M. Soares Kinjal Bari
Alan M.F. Souza
Proofreader
Reviewer Safis Editing
Saeed Afzal
Indexer
Commissioning Editor Hemangini Bari
Amarabha Banerjee
Graphics
Acquisition Editor Disha Haria
Rahul Nair
Production Coordinator
Content Development Editor Nilesh Mohite
Riddhi Tuljapurkar
Cover Work
Technical Editor Nilesh Mohite
Vivek Pala

Copy Editor
Tani Kothari
About the Authors

Fábio M. Soares holds a master's degree in applied computing from UFPA and
is currently a PhD candidate at the same university. He has been designing neural
network solutions since 2004 and has developed applications with this technique in
several fields, ranging from telecommunications to chemistry process modeling, and
his research topics cover supervised learning for data-driven modeling.
He is also self-employed, offering services such as IT infrastructure management as
well as database administration to a number of small- and medium-sized companies
in northern Brazil. In the past, he has worked for big companies such as Albras, one
of the most important aluminium smelters in the world, and Eletronorte, a great
power supplier in Brazil. He also has experience as a lecturer, having worked at the
Federal Rural University of Amazon and as a Faculty of Castanhal, both in the state
of Pará, teaching subjects involving programming and artificial intelligence.
He has published a number of works, many of them available in English, all
including the topics of artificial intelligence applied to some problem. His
publications include conference proceedings, such as the TMS (The Minerals Metals
and Materials Society), Light Metals and the Intelligent Data Engineering and
Automated Learning. He has also has published two book chapters for Intech.

I would like to give a special acknowledgement to God for having


given me the opportunity to get access to rich knowledge on this
theme, which I simply love doing research on. Special thanks to my
family, my father, Josafá, and mother, Maria Alice (in memoriam),
who would be very proud of me for this book, and also my brother,
Flávio, my aunt, Maria Irenice, as well as all my relatives who always
supported me in some way during my studies. I would also like to
thank the support of my advisor, Prof. Roberto Limão. I am very
grateful to him for having invited me to work with him on many
projects regarding artificial intelligence and neural networks. Also,
special thanks to my partners and former partners from Exodus
Sistemas, who have helped me in my challenges in programming and
IT infrastructure. Finally, I'd like to thank my friend Alan Souza, who
wrote this book with me, for having extended to me this authorship.
Alan M.F. Souza is computer engineer from Instituto de Estudos Superiores
da Amazônia (IESAM). He holds a post-graduate degree in project management
software and a master's degree in industrial processes (applied computing)
from Universidade Federal do Pará (UFPA). He has been working with neural
networks since 2009 and has worked with IT Brazilian companies developing in
Java, PHP, SQL, and other programming languages since 2006. He is passionate
about programming and computational intelligence. Currently, he is a professor at
Universidade da Amazônia (UNAMA) and a PhD candidate at UFPA.

Since I was a kid, I thought about writing a book. So, this book is a
dream come true and the result of hard work. I'd like to thank God
for giving me this opportunity. I'd also like to thank my father, Célio,
my mother, Socorro, my sister, Alyne, and my amazing wife, Tayná,
for understanding my absences and worries at various moments. I
am grateful to all the members of my family and friends for always
supporting me in difficult times and wishing for my success. I'd like
to thank all the professors who passed through my life, especially
Prof. Roberto Limão for introducing me the very first neural network
concept. I must register my gratitude to Fábio Soares for this great
partnership and friendship. Finally, I must appreciate the tireless
team at Packt Publishing for the invitation and for helping us in the
production process as a whole.
About the Reviewer

Saeed Afzal, also known as Smac Afzal, is a professional software engineer and
technology enthusiast based in Pakistan. He specializes in solution architecture and
the implementation of scalable high-performance applications.

He is passionate about providing automation solutions for different business needs


on the Web. His current research and work includes the futuristic implementation of
a next-generation web development framework, which reduces development time
and cost and delivers productive websites with many necessary and killer features by
default. He is hopeful of launching his upcoming technology in 2016.

He has also worked on the book Cloud Bees Development by Packt Publishing.

You can found out more about his skills and experience at http://sirsmac.com.
He can be contacted at [email protected].

I would like to thank the Allah Almighty, my parents, and my wife,


Dr. H. Zara Saeed, for all their encouragement.
www.PacktPub.com

Support files, eBooks, discount offers, and more


For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.
com and as a print book customer, you are entitled to a discount on the eBook copy.
Get in touch with us at [email protected] for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.
TM

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser

Free access for Packt account holders


If you have an account with Packt at www.PacktPub.com, you can use this to access
PacktLib today and view 9 entirely free books. Simply use your login credentials for
immediate access.
Table of Contents
Preface vii
Chapter 1: Getting Started with Neural Networks 1
Discovering neural networks 2
Why artificial neural network? 2
How neural networks are arranged 4
The very basic element – artificial neuron 5
Giving life to neurons – activation function 5
The fundamental values – weights 6
An important parameter – bias 7
The parts forming the whole – layers 7
Learning about neural network architectures 8
Monolayer networks 8
Multilayer networks 9
Feedforward networks 9
Feedback networks 10
From ignorance to knowledge – learning process 10
Let the implementations begin! Neural networks in practice 11
Summary 18
Chapter 2: How Neural Networks Learn 19
Learning ability in neural networks 19
How learning helps to solve problems 20
Learning paradigms 20
Supervised learning 20
Unsupervised learning 21
Systematic structuring – learning algorithm 22
Two stages of learning – training and testing 23
The details – learning parameters 24
Error measurement and cost function 25

[i]
Table of Contents

Examples of learning algorithms 26


Perceptron 26
Delta rule 27
Coding of the neural network learning 27
Learning parameter implementation 27
Learning procedure 29
Class definitions 30
Two practical examples 37
Perceptron (warning system) 37
ADALINE (traffic forecast) 41
Summary 46
Chapter 3: Handling Perceptrons 47
Studying the perceptron neural network 48
Applications and limitations of perceptrons 48
Linear separation 48
Classical XOR case 50
Popular multilayer perceptrons (MLPs) 52
MLP properties 52
MLP weights 53
Recurrent MLP 54
MLP structure in an OOP paradigm 55
Interesting MLP applications 56
Classification in MLPs 56
Regression in MLPs 58
Learning process in MLPs 60
Simple and very powerful learning algorithm – Backpropagation 61
Elaborate and potent learning algorithm – Levenberg–Marquardt 63
Hands-on MLP implementation! 65
Backpropagation in action 68
Exploring the code 68
Levenberg–Marquardt implementation 72
Practical application – types of university enrolments 75
Summary 78
Chapter 4: Self-Organizing Maps 79
Neural networks' unsupervised way of learning 80
Some unsupervised learning algorithms 80
Competitive learning or winner takes all 82

[ ii ]
Table of Contents

Kohonen self-organizing maps (SOMs) 84


One-Dimensional SOM 85
Two-Dimensional SOM 86
Step-by-step of SOM learning 88
How to use SOMs 89
Coding of the Kohonen algorithm 90
Exploring the Kohonen class 92
Kohonen implementation (clustering animals) 95
Summary 98
Chapter 5: Forecasting Weather 99
Neural networks for prediction problems 100
No data, no neural net – selecting data 101
Knowing the problem – weather variables 102
Choosing input and output variables 103
Removing insignificant behaviors – Data filtering 103
Adjusting values – data preprocessing 104
Equalizing data – normalization 105
Java implementation for weather prediction 107
Plotting charts 107
Handling data files 108
Building a neural network for weather prediction 109
Empirical design of neural networks 112
Choosing training and test datasets 112
Designing experiments 113
Results and simulations 113
Summary 116
Chapter 6: Classifying Disease Diagnosis 117
What are classification problems, and how can neural networks
be applied to them? 118
A special type of activation function – Logistic regression 119
Multiple classes versus binary classes 120
Comparing the expected versus produced results – the
confusion matrix 121
Classification measures – sensitivity and specificity 122
Applying neural networks for classification 123
Disease diagnosis with neural networks 126
Using ANN to diagnose breast cancer 126
Applying NN for an early diagnosis of diabetes 131
Summary 134

[ iii ]
Table of Contents

Chapter 7: Clustering Customer Profiles 135


Clustering task 136
Cluster analysis 137
Cluster evaluation and validation 138
External validation 138
Applied unsupervised learning 139
Neural network of radial basis functions 139
Kohonen neural network 140
Types of data 141
Customer profiling 142
Preprocessing data 142
Implementation in Java 143
Card credit analysis for customer profiling 143
Summary 149
Chapter 8: Pattern Recognition (OCR Case) 151
What is pattern recognition all about? 152
Definition of classes among tons of data 152
What if the undefined classes are undefined? 153
External validation 154
How to apply neural networks in pattern recognition 154
Preprocessing the data 155
The OCR problem 156
Simplifying the task – digit recognition 156
Approach to digit representation 157
Let the coding begin! 157
Generating data 158
Building the neural network 160
Testing and redesigning – trial and error 161
Results 163
Summary 166
Chapter 9: Neural Network Optimization and Adaptation 167
Common issues in neural network implementations 168
Input selection 168
Data correlation 169
Dimensionality reduction 170
Data filtering 171
Structure selection 171

[ iv ]
Table of Contents

Online retraining 172


Stochastic online learning 174
Implementation 174
Application 176
Adaptive neural networks 179
Adaptive resonance theory 179
Implementation 180
Summary 182
Appendix A: Setting up the NetBeans Environment 183
Download and install NetBeans 183
Setting up the NetBeans environment 188
Importing a project 191
Programming and running code with NetBeans 194
Debugging with NetBeans 195
Appendix B: Setting Up the Eclipse Environment 199
Download and install Eclipse 199
Setting up the Eclipse environment 204
Importing a project 205
Programming and running code with the Eclipse IDE 210
Debugging with the Eclipse IDE 211
Appendix C: References 213
Chapter 1 – Getting Started with Neural Networks 213
Chapter 2 – How Neural Networks Learn 213
Chapter 3 – Working with Perceptrons 213
Chapter 4 – Self-Organizing Maps 214
Chapter 5 – Forecasting the Weather 214
Chapter 6 – Disease Diagnosis 214
Chapter 7 – Clustering Customer Profiles 215
Chapter 8 – Pattern Recognition (the OCR Case) 215
Chapter 9 – Neural Network Optimization and Adaptation 215
Index 217

[v]
Preface
The life of a programmer can be described as a continual never-ending learning
pathway. A programmer always faces challenges regarding new technology or new
approaches. Generally, during our lives, although we become used to repeated
things, we are always subjected to learn something new. The process of learning is
one of the most interesting topics in science, and there are a number of attempts to
describe or reproduce the human learning process.

The writing of this book was guided by the challenge of facing new content and
then mastering it. While the name neural networks may appear strange or even give
an idea that this book is about neurology, we strived to simplify these nuances by
focusing on your reasons for deciding to purchase this book. We intended to build
a framework that shows you that neural networks are actually simple and easy to
understand, and absolutely no prior knowledge on this topic is required to fully
understand the concepts we present here.

So, we encourage you to explore the content of this book to the fullest, beholding
the power of neural networks when confronting big problems but always with the
point of view of a beginner. Every concept addressed in this book is explained in easy
language, and also with a technical background. Our mission in this book is to give
you an insight into intelligent applications that can be written using a simple language.

Finally, we would like to thank all those who directly or indirectly have contributed
to this book and supported us from the very beginning, right from the Federal
University of Pará, which is the university that we graduated from, to the data and
component providers INMET (Brazilian Institute of Meteorology), Proben1, and
JFreeCharts. We want to give special thanks to our advisor Prof. Roberto Limão, who
introduced us to the subject of neural networks and coauthored many papers with
us in this field. We also acknowledge the work performed by several authors cited
in the references, which gave us a broader vision on neural networks and insights on
how to adapt them to the Java language in a didactic way.

[ vii ]
Preface

We welcome you to have a very pleasurable reading experience and you are
encouraged to download the source code and follow the examples presented
in this book.

What this book covers


Chapter 1, Getting Started with Neural Networks, is an introductory foundation on
the neural networks and what they are designed for. You will be presented with
the basic concepts involved in this book. A brief review of the Java programming
language is provided. As in all subsequent chapters, an implementation of a neural
network in Java code is also provided.

Chapter 2, How Neural Networks Learn, covers the learning process of neural networks
and shows how data is used to that end. The complete structure and design of a
learning algorithm is presented here.

Chapter 3, Handling Perceptrons, covers the use of perceptrons, which are one of the
most commonly used neural network architectures. We present a neural network
structure containing layers of neurons and show how they can learn by data in
basic problems.

Chapter 4, Self-Organizing Maps, shows an unsupervised neural network architecture


(the Self-Organising Map), which is applied to finding patterns or clusters in records.

Chapter 5, Forecasting Weather, is the first practical chapter showing an interesting


application of neural networks in forecasting values, namely weather data.

Chapter 6, Classifying Disease Diagnostics, covers another useful task neural networks
are very good at—classification. In this chapter, you will be presented with a very
didactic but interesting application for disease diagnosis.

Chapter 7, Clustering Customer Profiles, talks about how neural networks are able to
find patterns in data, and a common application is to group customers that share the
same properties of buying.

Chapter 8, Pattern Recognition (OCR Case), talks about a very interesting and amazing
capability of recognizing patterns, including optical character recognition, and this
chapter explores how this can be done with neural networks in the Java language.

Chapter 9, Neural Network Optimization and Adaptation, shows advancements


regarding how to optimize and add adaptability to neural networks, thereby
strengthening their power.

[ viii ]
Preface

What you need for this book


You'll need Netbeans (www.netbeans.org) or Eclipse (www.eclipse.org). Both are free
and available for download at the previously mentioned websites.

Who this book is for


This book is targeted at both developers and enthusiasts who have a basic or even no
Java programming knowledge. No previous knowledge of neural networks is required,
this book will teach from scratch. Even if you are familiar with neural networks and/or
other machine learning techniques but have little or no experience with Java, this book
will take you to the level at which you will be able to develop useful applications. Of
course, if you know basic programming concepts, you will benefit most from this book,
but no prior experience is required.

Conventions
In this book, you will find a number of text styles that distinguish between different
kinds of information. Here are some examples of these styles and an explanation of
their meaning.

Code words in text, database table names, folder names, filenames, file
extensions, pathnames, dummy URLs, user input, and Twitter handles are shown
as follows: "In Java projects, the calculation of these values is done through the
Classification class."

A block of code is set as follows:


Data cardDataInput = new Data("data", "card_inputs_training.csv");
Data cardDataInputTestRNA = new Data("data", "card_inputs_test.
csv");
Data cardDataOutputTestRNA = new Data("data", "card_output_test.
csv");

New terms and important words are shown in bold.

Warnings or important notes appear in a box like this.

Tips and tricks appear like this.

[ ix ]
Preface

Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or disliked. Reader feedback is important for us as it helps
us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail [email protected], and mention


the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.

Downloading the example code


You can download the example code files from your account at http://www.
packtpub.com for all the Packt Publishing books you have purchased. If you
purchased this book elsewhere, you can visit http://www.packtpub.com/support
and register to have the files e-mailed directly to you.

Errata
Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you find a mistake in one of our books—maybe a mistake in the text or
the code—we would be grateful if you could report this to us. By doing so, you can
save other readers from frustration and help us improve subsequent versions of this
book. If you find any errata, please report them by visiting http://www.packtpub.
com/submit-errata, selecting your book, clicking on the Errata Submission Form
link, and entering the details of your errata. Once your errata are verified, your
submission will be accepted and the errata will be uploaded to our website or added
to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/


content/support and enter the name of the book in the search field. The required
information will appear under the Errata section.

[x]
Preface

Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all
media. At Packt, we take the protection of our copyright and licenses very seriously.
If you come across any illegal copies of our works in any form on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.

Please contact us at [email protected] with a link to the suspected pirated


material.

We appreciate your help in protecting our authors and our ability to bring you
valuable content.

Questions
If you have a problem with any aspect of this book, you can contact us at
[email protected], and we will do our best to address the problem.

[ xi ]
Getting Started with
Neural Networks
In this chapter, we will introduce neural networks and what they are designed for.
This chapter serves as a foundation layer for the subsequent chapters, while
it presents the basic concepts for neural networks. In this chapter, we will cover
the following:

• Artificial Neurons
• Weights and Biases
• Activation Functions
• Layers of Neurons
• Neural Network Implementation in Java

[1]
Getting Started with Neural Networks

Discovering neural networks


First, the term "neural networks" may create a snapshot of a brain in our minds,
particularly for those who have just been introduced to it. In fact, that's right, we
consider the brain to be a big and natural neural network. However, what if we talk
about artificial neural networks (ANNs)? Well, here comes an opposite word to
natural, and the first thing now that comes into our head is an image of an artificial
brain or a robot, given the term "artificial." In this case, we also deal with creating
a structure similar to and inspired by the human brain; therefore, this can be called
artificial intelligence. So, the reader who doesn't have any previous experience with
ANN now may be thinking that this book teaches how to build intelligent systems,
including an artificial brain, capable of emulating the human mind using Java codes,
isn't it? Of course, we will not cover the creation of artificial thinking machines such
as those from the Matrix trilogy movies; however, this book will discuss several
incredible capabilities that these structures can do. We will provide the reader
with Java codes for defining and creating basic neural network structures, taking
advantage of the entire Java programming language framework.

Why artificial neural network?


We cannot begin talking about neural networks without understanding their origins,
including the term as well. We use the terms neural networks (NN) and ANN
interchangeably in this book, although NNs are more general, covering the natural
neural networks as well. So, what actually is an ANN? Let's explore a little of the
history of this term.

In the 1940s, the neurophysiologist Warren McCulloch and the mathematician


Walter Pits designed the first mathematical implementation of an artificial neuron
combining the neuroscience foundations with mathematical operations. At that
time, many studies were being carried out on understanding the human brain and
how and if it could be simulated, but within the field of neuroscience. The idea
of McCulloch and Pits was a real novelty because it added the math component.
Further, considering that the brain is composed of billions of neurons, each one
interconnected with another million, resulting in some trillions of connections, we
are talking about a giant network structure. However, each neuron unit is very
simple, acting as a mere processor capable to sum and propagate signals.

[2]
Chapter 1

On the basis of this fact, McCulloch and Pits designed a simple model for a
single neuron, initially to simulate the human vision. The available calculators or
computers at that time were very rare but capable of dealing with mathematical
operations quite well; on the other hand, even today tasks such as vision and sound
recognition are not easily programmed without the use of special frameworks, as
opposed to the mathematical operations and functions. Nevertheless, the human
brain can perform these latter tasks more efficiently than the first ones, and this fact
really instigates scientists and researchers.

So, an ANN is supposed to be a structure to perform tasks such as pattern


recognition, learning from data, and forecasting trends, just like an expert can do on
the basis of knowledge, as opposed to the conventional algorithmic approach that
requires a set of steps to be performed to achieve a defined goal. An ANN instead
has the capability to learn how to solve some task by itself, because of its highly
interconnected network structure.

Tasks Quickly Solvable by Humans Tasks Quickly Solvable by Computers


Classification of images Complex calculation
Voice recognition Grammatical error correction
Face identification Signal processing
Forecast events on the basis of Operating system management
experience

[3]
Getting Started with Neural Networks

How neural networks are arranged


It can be said that the ANN is a nature-inspired structure, so it does have similarities
with the human brain. As shown in the following figure, a natural neuron is
composed of a nucleus, dendrites, and axon. The axon extends itself into several
branches to form synapses with other neurons' dendrites.

So, the artificial neuron has a similar structure. It contains a nucleus (processing
unit), several dendrites (analogous to inputs), and one axon (analogous to output), as
shown in the following figure:

The links between neurons form the so-called neural network, analogous to the
synapses in the natural structure.

[4]
Chapter 1

The very basic element – artificial neuron


Natural neurons have proven to be signal processors since they receive micro signals
in the dendrites that can trigger a signal in the axon depending on their strength or
magnitude. We can then think of a neuron as having a signal collector in the inputs
and an activation unit in the output that can trigger a signal that will be forwarded
to other neurons. So, we can define the artificial neuron structure as shown in the
following figure:

In natural neurons, there is a threshold potential that


when reached, fires the axon and propagates the signal to
the other neurons. This firing behavior is emulated with
activation functions, which have proven to be useful in
representing nonlinear behaviors in the neurons.

Giving life to neurons – activation function


The neuron's output is given by an activation function. This component adds
nonlinearity to neural network processing, which is needed because the natural
neuron has nonlinear behaviors. An activation function is usually bounded between
two values at the output, therefore being a nonlinear function, but in some special
cases, it can be a linear function.

The four most used activation functions are as follows:

• Sigmoid
• Hyperbolic tangent
• Hard limiting threshold
• Purely linear

[5]
Getting Started with Neural Networks

The equations and charts associated with these functions are shown in the
following table:

Function Equation Chart

Sigmoid

Hyperbolic
tangent

Hard
limiting
threshold

Linear

The fundamental values – weights


In neural networks, weights represent the connections between neurons and have the
capability to amplify or attenuate neuron signals, for example, multiply the signals,
thus modifying them. So, by modifying the neural network signals, neural weights
have the power to influence a neuron's output, therefore a neuron's activation will
be dependent on the inputs and on the weights. Provided that the inputs come from
other neurons or from the external world, the weights are considered to be a neural
network's established connections between its neurons. Thus, since the weights are
internal to the neural network and influence its outputs, we can consider them as
neural network knowledge, provided that changing the weights will change the
neural network's capabilities and therefore actions.

[6]
Chapter 1

An important parameter – bias


The artificial neuron can have an independent component that adds an extra signal
to the activation function. This component is called bias.

Just like the inputs, biases also have an associated weight. This feature helps in the
neural network knowledge representation as a more purely nonlinear system.

The parts forming the whole – layers


Natural neurons are organized in layers, each one providing a specific level of
processing; for example, the input layer receives direct stimuli from the outside
world, and the output layers fire actions that will have a direct influence on the
outside world. Between these layers, there are a number of hidden layers, in the
sense that they do not interact directly with the outside world. In the artificial neural
networks, all neurons in a layer share the same inputs and activation function, as
shown in the following figure:

Neural networks can be composed of several linked layers, forming the so-called
multilayer networks. The neural layers can be basically divided into three classes:

• Input layer
• Hidden layer
• Output layer

In practice, an additional neural layer adds another level of abstraction of the


outside stimuli, thereby enhancing the neural network's capacity to represent more
complex knowledge.

[7]
Getting Started with Neural Networks

Every neural network has at least an input/output layer


irrespective of the number of layers. In the case of a
multilayer network, the layers between the input and the
output are called hidden.

Learning about neural network


architectures
Basically, a neural network can have different layouts, depending on how the
neurons or neuron layers are connected to each other. Every neural network
architecture is designed for a specific end. Neural networks can be applied to a
number of problems, and depending on the nature of the problem, the neural
network should be designed in order to address this problem more efficiently.

Basically, there are two modalities of architectures for neural networks:

• Neuron connections
°° Monolayer networks
°° Multilayer networks

• Signal flow
°° Feedforward networks
°° Feedback networks

Monolayer networks
In this architecture, all neurons are laid out in the same level, forming one single
layer, as shown in the following figure:

[8]
Random documents with unrelated
content Scribd suggests to you:
CHAPTER XVI.
I AM 'DON ALONZO.'
It was a splendid evening one day towards the end of the year 1503,
when a tall, plainly-attired, handsome youth drew near the home of a
Spanish colonist to whom he had notes of introduction. He had
walked out to it from San Domingo, a distance of some five miles,
and now stood still to survey the scene, his hand resting on a dog's
head the while that had accompanied him.
"It is a glorious place, old Don," he muttered in a tone of
considerable satisfaction, although it betokened great surprise as
well.
And a glorious place it was, and most especially beautiful now that
the long, low houses of stone and earth, the waving palms, and all
the other luxuriance of that southern clime, were bathed in the
golden glory of a southern sunset. In a cushioned reclining chair,
placed in a shady spot of the broad verandah, lounged a young man,
handsome, but for a Spaniard coarse-featured and rather thick-set.
However, all defects of person were thrown into the background by a
sumptuousness of attire that fairly startled the youth as he at length
approached, and delivered his letters.
"And you are the son of Master Pedro, the spice-dealer of El Cuevo!"
he breathed forth at last.
The words of that ejaculation were common-place enough, but the
tone in which they were uttered, and the look with which they were
accompanied, made them so inexpressibly gratifying, and at the
same time comical, to the man to whom they were addressed, that
he burst into a loud, long laugh before vouchsafing them any other
answer.
"Yes, yes," he said at last, recovering himself with an easy
nonchalance. "Yes, yes, youngster, I do not mind confessing to you,
since you know the fact before my confession, that the worthy old
gentleman yonder, with his frugal fare, and his better stuff cloak for
holidays, is my father, and a rare good old miser he is, to save the
maravedis for my spending. But mind ye, that is between you and
me and Saint Peter."
A wondering gaze from a great pair of thoughtful, brilliant eyes was
the questioning reply to this intimation. "And for the rest of the
world," asked the owner of the eyes after a short pause, "who is your
father for the rest of the world?"
Another laugh greeted this query.
"Why, for the rest of the world, being what you have found me, Don
Alonzo de Loyala, my father is, like thine own, some long-deceased
grandee of Spain, who neglected his duty towards his son as
regarded the due endowment of riches to maintain my rank in mine
own land."
As this mocking speech ended, Montoro de Diego's cheeks flushed
angrily, and he exclaimed—
"Do you then imply that my claims to noble birth are thus also
assumed? By St.—"
"Nay then, nay," good-humouredly interrupted the other. "In these
latitudes it is not well for health to heat thyself for nought. Keep thy
passion for the red rascals, who are so lazy that they'll die rather
than live and work. I imply nothing to thy detriment. Wert thou placed
as I am, then wouldst thou also have a wealthy father at thy back, to
help thee to maintain that rank out here it should pleasure thee to
claim. Meantime, I do no more than half of those around me, and
with better right; for I am no released felon, and I deal honestly by
those I trade with. I will deal honestly with you. Twice have I had
advices from my father, and from good master Sancho, that I should
try to secure you for a companion and aid, should you elect to
remain here on the Admiral's return to Spain. And I like you at first
sight well enough to be willing to take their advice. Will you stay with
me then, or shall I help you to find friends elsewhere?"
Montoro looked at the man from head to foot slowly and earnestly,
as he lounged there before him, so great a contrast to himself, and
then as slowly and earnestly said—
"I agree to stay—for a time."
"Umph!" muttered the self-styled Don Alonzo, somewhat taken
aback in his turn. "Umph! my noble youngster, methinks from your air
you suppose the obligation to be rather more mutual than I esteem it.
You are a beggar and friendless, and I—am not."
However, Montoro was not now so friendless as his new colleague
assumed. Had he returned to Spain, even there he might now have
been found some sort of employment, and out in the Colony the
spirited young adventurer, with a pair of hands both able and willing
to work, could have easily found some more indolent seeker after
wealth willing to go into partnership with him. But Rachel de Diego
was sheltered under the roof of the spice-merchant, and her son had
a hidden eagerness that he might be able to find shelter under the
roof of the spice-merchant's son. It was to that motive that 'Don
Alonzo' owed the easy settlement of his agreement with his new
young partner, and not, as he imagined, to the promising air of
luxurious comfort in his surroundings. That offered more allurements
to a third party to the affair.
Don threatened for a few minutes to upset the amiable arrangements
between his real owner and his self-adopted master, for poor Don
had very faint notions of the rights of property and ownership, and
Don was thirsty and Don was hungry, and, moreover, Don was as
fond of grapes as any Christian Don, real or pretended, to be found
in or out of Spain. All of a sudden, while Montoro was gazing
thoughtfully out at the silver line of distant sea, and Don Alonzo was
muttering to himself the remark mentioned above, tired Don caught
sight of a piled-up dish of grapes on a table in the verandah. He
licked his dry lips, and went on eyeing them. Then he licked his dry
lips again, and ventured upon a small whine. That sound recalled
Montoro's wandering wits so far that he turned round and nodded to
his four-footed friend, and said dreamily—
"Yes, yes. All right, good old Don."
That was enough. Don was in that state of longing that a very small
amount of encouragement was enough to induce him to help himself
to the desired feast, and before either of his companions knew well
what he was about, he had bounded up to the table, scrunched up
one juicy, deliciously refreshing bunch of grapes, and had a second
in his mouth about to be treated in the same way. But "there's many
a slip 'twixt the cup and the lip," and in this instance there proved to
be a slip 'twixt the lip and the throat.
Don Alonzo quickly became aware of what was going on, and,
seizing a heavy bottle, he flung it with full force angrily at the dog;
and it hit, not the dog, but the dog's champion, happily only a touch,
and then fell crashing on the floor of the verandah.
The next instant Montoro's first dash forward to save the dog was
followed by a second to save Don Alonzo; for the huge animal had
made a furious spring at his antagonist, accompanied by a growl that
gave full promise of his intentions. Montoro's most resolute and stern
command was needed before the hound was brought to crouch
down by his side, with red-lit eyes still glaring at his unrecognized
owner.
"That brute shall be shot before he's an hour older," came the surly
declaration at last, as Montoro knelt on the stone pavement soothing
the animal back into good temper. At the sharp announcement he
looked up quickly.
"Then you shall shoot him through me," he said passionately, "as
you struck me just now instead of him. He is my only friend out here,
and we will live or die together."
Don Alonzo shook himself irritably. He was good-hearted enough if
over-indulgent parents in the first instance, and superabundant good
fortune since, had not rather spoilt him. Besides, four years' sojourn
on the island of Hispaniola had not tended to teach regard for any
life but his own; that he esteemed at quite a high enough rate, and
he answered Montoro now with angry remonstrance—
"It is all very fine to talk heroics, youngster; but thinkest thou that I
am going to be browbeaten into keeping my own dog, to stand in
danger of being mauled by it any time its tempers up, as if I were a
wretched native!"
Montoro stood up and folded his arms.
"Neither you nor any other man, Indian or European, shall suffer
from Doffs teeth. Or, if perchance that sounds too proud a boast, for
the first human being that Don injures he shall die. He shall be as a
lamb to you now—see—hold out your hand."
With some scarcely-disguised trepidation Alonzo obeyed. Don cast a
beseeching glance of remonstrance at his friend; but instead of any
encouragement to rejection of the offered fellowship, he got a grave
shake of the head; and with a very crestfallen aspect he rose,
walked dolefully along the verandah, and put his paw into the
outstretched hand, and looked up with mute appeal for forgiveness.
Don Alonzo was wise enough to seal the new compact with a freely-
generous gift of more of the coveted grapes. If Montoro for Don, and
Don for himself, would engage that Don Alonzo should never feel the
sharpness of that animal's teeth, his owner was only too willing that it
should live. For it was quite the fashion now to use these powerful
dogs out in the new world, not only as terrible aids in battle against
the poor, half-defenceless Indians, but also to hunt down the
miserable, wholly-defenceless slaves who sometimes dared to run
away to die in peace in their native forests, instead of beneath the
short-sighted, as well as brutal, taskmaster's lash.
The young Diego had declared that Don should never be so
employed, but that declaration Don Alonzo comfortably decided in
his own mind was all nonsense. He himself had had qualms about
the treatment of the natives when he first came out, but he had long
since got rid of all such inconvenient scruples; and so of course
would this new arrival get speedily rid of his. Every one did, with the
exception of that impracticable idiot of a neighbour of his, that young
fellow Las Casas, who had come out from Spain with his head so full
of theories and bookish ideas that he had no room in it for common
sense.
CHAPTER XVII.
GOOD OLD DON.
Time passed on. In Spain good Queen Isabella died, and two years
later the poor, neglected noble-hearted, pious old Admiral,
Christopher Columbus, recommending himself to God, and his two
sons, Diego and Ferdinand, to King Ferdinand's tardy justice and
each other's brotherly love, also bade a final farewell to an ungrateful
world.
And in Hispaniola also time passed on. Many there grieved over the
Admiral when he was dead, who had tormented him in every
possible way when living,—that is the way with poor, stupid human
nature. But he had one true mourner, who had loved and served him
with all his heart during the year that they were together, and whose
memory for those he cared for was not a short one. Montoro de
Diego, amidst his many new interests, felt a very keen pang of
sorrow when the news was brought out to the island, towards the
end of the year 1506, of the loss the world had sustained.
"Ah! Señor Las Casas," he sighed one morning, some months later;
"ah! then, if he had lived, and the queen, you might then have had
hope even yet to work some good for these wretched, rightful
owners of these lands. But now—"
"Ay, indeed!" exclaimed Bartholomew Las Casas with heaving chest,
as he rose and strode hastily up and down his terrace. "You may well
pause upon that but now, Diego. For now one might more wisely
waste breath in calling upon wolves and wild cats to cease from
fierceness, than in pleading with one's fellow-men for mercy, justice,
or compassion. 'Give us yourselves,' is the fierce cry that echoes all
around us. 'Give us yourselves, your wives and daughters, for our
humble slaves; give us your gold, your lands, all you hold most
valuable; resign your wills, your faith, your souls into our keeping,
and we will give you leave to live as long as unremitting toil and
cruelty will let you. But resist us, fight for your country or your liberty,
contradict our lightest caprice, and we will shoot you down as though
you were so many rabbits, we will hunt you to death with our dogs as
though you were vermin or wild beasts.'"
The young man came to a sudden stop, with a face glowing with
generous indignation, and literally panting for breath with his burst of
righteous wrath. Montoro's cheeks were flushed with sympathy as he
said in quick reply—
"It is so. I can but too terribly vouch for the truth of your bitter
accusation. But, Señor, your brethren the priests, can they not—"
Las Casas turned upon him with sharp interruption.
"Can they not help me, you would ask? Ay, verily," with indignant
scorn; "well indeed do they help the cause I have at heart! This is
one of the proclamations allowed by some of those same brethren
the priests—'Your souls are doomed to eternal perdition, your bodies
belong to those who have conquered your soil!' Much good my
brethren the priests will do!"
There was a short silence, and then he continued more calmly, and
laying his hand upon a pile of papers, "But after all, Diego, I do hope
to work some good for the poor natives. I have written out a strong
case for them, and I am intending to return to Spain shortly, there to
plead their cause myself."
"And you shall have my testimony, if you will," said Montoro eagerly.
"For it is our Don Alonzo's will that I should take a journey to Spain
this coming season, in charge of a somewhat richer freight than
usual. And if you start not immediately we may go together."
"And Don?" said Las Casas, in smiling interrogation.
"Ay, truly," was the laughing answer, although something of a blush
accompanied it. "But in faith," he added the next moment, "it is not
only for love of the animal that I have it for my constant companion.
Since I have discovered the horrible use to which its fellows are put,
I live in fear of a coming day when I may regret having saved its life."
"Then," continued his friend, "you will leave it behind you in Spain
perchance, when you return hither?"
"That is so long to look ahead," said Montoro, feeling not a little glad
that he was not called upon for an immediate decision.
When it really came to the point he did what he thought much better
than leaving Don behind in El Cuevo. He got Master Pedro to
transfer all property in it to himself. His services to the old spice-
dealer and his son had well merited so much of a reward. And as for
Don, he deserved not only a good master, but almost as many
bunches of grapes besides as he chose to eat, when, a couple of
years later, he was the means of saving Montoro's life and a bag full
of gold-dust to the value of many thousand pesos.
Diego's first return journey to Spain proved so successful, owing to
his scrupulous honesty and intelligence, that Don Alonzo speedily
sent him on a second, and others also most eagerly availed
themselves of so upright a messenger to transmit their golden
gleanings to their own country.
But, as it happened, with Diego there voyaged also to Spain three
ne'er-do-wells. They had gambled away all their slaves, all their
grants of land, all their gathered-up spoils, and then, having finally
gambled away all their future prospects of wealth in Hispaniola, the
miscreants, as mean as they were bad, slipped away from the island
and their creditors on the first ship back to Spain.
"And mind ye," muttered one of the number to his companions one
evening, as they drew near the end of their two months' voyage,
—"mind ye, if we follow that insolent, set-up fellow Diego a day or
two's journey up the country after landing, we shall not be losing
time, neither shall we have cause to regret having left Hispaniola in
his company."
"How so?" questioned one of the two eager listeners doubtfully. "My
child yonder, little Bautista, told me when I questioned him some
days ago anent Diego's gold, that the bags were to be sent by other
hands to Madrid."
"And you credit the tale!" exclaimed the first speaker scornfully.
"You'll believe next that the Garden of Paradise has been found."
"And so I will," was the retort, "when the news is given me by
Montoro de Diego. He would not lie to save his life, and least of all
would he lie to a child."
"By all the saints," sneered the third of the group, "but Don Diego
hath a warm advocate in you! Doubtless it were useless to expect
you to touch his gold, even though it lay by the wayside to be picked
up."
"Doubtless under those circumstances," was the sharp reply, "there
should be little left for you to snatch. All the same, he hath shown
kindness to my boy, and he tells him nought but truth."
"Well, well," said Almado, the first speaker, more softly, "there is no
need that we should wrangle over the fellow's virtues, they sicken
me forsooth. Ne'er the less, he shall be a very saint if you will, so we
do but get his merchandise. As for the gold that is to go to Madrid,
that is but that small part, of what he carries, which is for the king's
coffers. Of that I am well assured. So you see thy little son yonder
hath been told the truth indeed, but only in part, and maybe to
mislead us."
"Umph," muttered Bautista's father, also more quietly. "That may well
be."
"Ay," agreed the third of the company, "that may well be."
And for the next few hours they all redoubled their efforts to be on
good terms with Don. They flattered themselves, indeed, that he
regarded them quite in the light of friends, for Don, like most very
strong creatures, whether going on two legs or four, never troubled
himself to show uncalled-for fierceness. As long as no one interfered
with him or his master, and his master gave him no orders to
interfere with others, he maintained the grave indifference of manner
worthy of a highborn Spaniard. But woe betide those who should
presume upon this calmness.
Arrived at Cadiz, Montoro delivered up the royal revenue to the
authorized messengers awaiting it, and then he and his dog and his
bags set out on their journey up the country, in company with worthy
Master Sancho, who had come to meet him, and two or three other
traders from the interior.
"Farewell, my little Bautista," said Montoro; "I shall pray for our future
meeting."
"Nay," said the child hurriedly, and with a frightened look round, "do
not that, Señor. I love you, you have been good to me, and so I pray
the Virgin to grant we may not meet again."
Montoro opened his eyes wide.
"How so, little man? Love me, and yet pray that we may not again
cross each other's paths? How is that, tell me?"
But the boy shook his head, and began to tremble violently.
"Do not ask me," he muttered with white lips; "they will kill me. Only
keep away from us. They do not know I have heard——"
"Ha!" exclaimed Montoro, a look of intelligence now taking the place
of bewilderment. Then he stooped and kissed the child's forehead,
as he said in low tones, "Blessings on thee for thy true heart, my little
lad, and my thanks. May the Lord have thee in His keeping, and
guard thy hands from sin."
And so they parted, each, as poor little Bautista fondly thought, to go
widely different ways, but in reality to take two routes leading to the
same goal.
For the first two days' journey inland the party to which Montoro
joined himself was a particularly strong one, too strong for the three
gamblers to care to meddle with; accordingly they withdrew
themselves from notice, until the travelling company was reduced to
Montoro himself, Master Sancho and his thick-headed attendant,
and a couple of poor-spirited merchants, who would have rather
hidden themselves in their bales at the appearance of danger, than
tried to defend them. But then—there was Don.
The third day was drawing to a close, when Diego and his
companions reached a wretched little inn, the worst on their route,
and with considerable grumbling on the part of comfort-loving Master
Sancho, they put up there for the night. To make matters worse, the
amount of available accommodation was even less than usual, for
another party of travellers had arrived before them, and taken the
chief and largest room.
However, there was no help for it. Master Sancho had to make the
best of a bad bargain, and as nothing would induce him to share a
room with Don, and nothing would induce Montoro to dispense with
Don's company as a guardian under present circumstances, he and
the dog had one room, and the worthy burgess of El Cuevo and the
two merchants from Saragossa had to crowd into the other.
"One night," explained Master Sancho to his companions, "that
young rascal I've taken a fancy to, persuaded me to share a sleeping
apartment with him and that great brute, and in the night I snored,—
I'm given to snore,—and the creature didn't approve, and woke me
up with a sounding thump of its great paw. And there, behold! it
stood reared up over me, with glaring eyes and a growling mouth. I
warrant you, I prayed in one minute to more saints in the calendar
than I've prayed to in many a long year before."
"Doubtless," assented one of the merchants with paling cheeks. "I
have ever thought it a fearful great beast, and unsafe. But hearken!
Methinks it is now quarrelling even with its own master. Ah!" with
startled breathlessness—"it is shot."
Then there was a sudden rushing all over the inn. Screams, shrieks,
shouts, slamming of doors, and above all, the continuous roar of
Don's deep growling bark.
At length men and lights were gathered in Montoro's room, and there
stood Montoro holding in a firm grip one of the smugglers. But the
hero of the fray, and the conqueror, was grand old Don standing with
one great fore-paw on the breast of one robber, the other fore-paw
on the breast of Bautista's father, who lay weltering in his blood, shot
by the other of his comrades in the attempt to shoot the dog.
"But my child, my little son," murmured the wretched, dying man.
"I will guard and care for him," said Montoro huskily.
He had been rescued from misery himself once, now he was the
rescuer.
CHAPTER XVIII.
DEATH FOR DON.
It was the early part of the year 1511, when Montoro, become now
quite an experienced islander and man of business, left Don
Alonzo's place, Palmyra, one morning for the neighbouring town of
San Domingo. The object of the visit was to arrange some important
matters with certain foreign merchants, who had lately arrived with
tempting offers to the planters for the produce of their estates.
"And don't hurry thyself," said Don Alonzo with unusual
consideration. "Take thy pleasure for a few days when thou art in the
town, for verily this dog's hole of a place is dull enough to make a
man long to shuffle off life with a native's readiness."
"If those same natives should get the upper-hand," answered
Montoro drily, "I doubt not they would help you. Meantime, I will trust
to find you still in the flesh, and well, when I return, and so—adios."
"And for you, fair journeyings and good bargains," said the indolent
superior, as he lay lounging in his low chair sipping a cool lime-juice
beverage. Little enough of the work he did himself towards
accumulating his own wealth.
But, lazy and self-indulgent as he was, it had not escaped Montoro
that there was a certain scarcely-suppressed eagerness, and barely-
hidden hope of some sort, underlying his present declared wishes for
his subordinate's comfort. As Montoro left the verandah and passed
through the house he called to his rescued protégé, who had proved
useful enough to secure himself a home beneath Don Alonzo's roof.
No work had seemed to come amiss to him, excepting that of aid to
the overseers in the gold mines, in which he had been recently
employed. But the brutal task-masters had just sent the boy back,
saying that he was no good to them whatever, worse than no good
indeed, for he pitied the rascally workers instead of flogging them.
Bautista came readily enough when he heard his beloved Señor
Diego's voice.
"Am I to go with you, my Señor?" he exclaimed beseechingly. "Ah!
but I will be to you eyes and hands and feet, if I may."
"I prefer to use my own, thank you," answered Montoro smiling, as
he patted the boy's head. "But look not so disappointed, Bautista, for
if I cannot trust myself to thee, I am going to leave in thy charge one
I hold almost dearer. I leave thee guardian of our faithful old Don.
And see thou that he comes to no harm, and—that he does no harm.
I have guarded him from that sin hitherto; do thou guard him in my
absence."
A deep breath, almost a groan, burst from the boy's lips.
"My Señor," he muttered anxiously, "give me some other duty to
perform for you. This may be too hard."
Diego frowned.
"I trust not," he said sternly. "It shall be worse for others if it prove so.
And remember, you have my orders, and if need be you must
declare them."
So saying he nodded his farewell to the boy and departed, leaving
Don's new guardian in a very doleful frame of mind, for he knew well
enough the cause of Don Alonzo's desire to be a short time rid of
Montoro.
The spice-merchant's son was good-natured enough so long as he
was crossed in nothing, but Montoro's settled refusal to have Don
used as a hunter of runaway slaves had roused Alonzo's spite, and
for the past year, ever since the return of Montoro and the dog from
Spain, he had been seeking some chance to gratify his malice.
Hitherto where Diego had gone the dog had gone, but at last this
expedition to the town was arranged, and for various circumstances
it was more convenient to leave Don behind.
"And at last," declared Don Alonzo with a malicious chuckle, "at last
the brute shall be set to its proper work."
Bautista was in the apartment at the time, as well as one of the
overseers, and as a significant warning to him the words were added
—"And it shall have its first taste of the flesh of any one, be he
Spaniard or native, who betrays my purpose to Señor Long-face."
No wonder the boy desired that some other duty might be commuted
to his charge by his patron, in test of his affection. As Montoro rode
off with a party of attendants, Bautista made his way to Don, and
poured out his fears to an apparently perfectly intelligent pair of ears.
"But all the same, you know quite well, Don," said Bautista
reproachfully, "you do know quite well, that in spite of your good
Christian bringing up, you would seize a poor redskin by the leg if
you were set at him."
"Of course he would, like the sensible thoroughbred he is," shouted
a well-known voice not a couple of yards distant. And Bautista
sprang to his feet with a terrified look on his face, as he saw the
hateful head overseer, Jerome Tivoli, had come up to him
unperceived.
The man now stood intently regarding the dog, with a more sinister
expression than usual upon his cruel face, and the boy could
scarcely restrain himself from flying away from the spot. Nothing
short of his loyal devotion to his patron could have kept him there. At
last he said huskily—
"It is useless so to examine this dog, for, strong or weak, you can
have nought to do with it, since it belongs to the Señor Diego, and he
chooses not that it should be used for your purposes."
De Tivoli uttered a short, hard laugh, and his eyes glittered as he
said slowly—
"Ah! yes. It is the Señor Montoro de Diego's dog—-his favourite. And
verily it is a fine animal, and powerful, and will do a day's work well
for us. That dog of a slave Guatchi has run away, and, dead or alive,
yon pet of our Señor Diego shall bring him back to us."
Bautista flung himself down again beside the dog, and threw his
arms about its neck, as he exclaimed with the courage of affection—
"No! I tell thee no, Señor Tivoli. Señor Diego has left it to me to
guard his dog from doing harm, and I will keep my charge."
De Tivoli's thin lips curled; but ere he could reply other footsteps
were heard approaching, and Don Alonzo himself appeared upon
the scene.
"How now, De Tivoli," he exclaimed hastily. "Why dost thou waste
time? The idle rascal Guatchi hath had start enough, I trow, to
breathe the dog e'en now; why dost thou delay?"
"It is but for a minute, Don Alonzo," replied the other coolly. "Yon boy
declares that, for Don Diego's sake, it shall not be sent hunting."
"And I," retorted Don Alonzo, "swear by St. Jago that it shall."
"And I, in the name of one higher," exclaimed Montoro de Diego,
thus unexpectedly making his own appearance on the scene again,
"I declare, with Bautista, that it shall not go."
Don Alonzo started slightly, and his face flushed for a moment with
ill-restrained annoyance and uneasiness as he saw that set, resolute
countenance before him; but he tried to assume an air of
carelessness, and to laugh away the matter with an off-hand—
"Why, my mentor, how have you contrived to accomplish the
business you had in hand so quickly? What brings you back so
soon?"
"Your good genius, I feel inclined to imagine," was Montoro's answer,
in tones somewhat quieter than those of his first exclamation. But the
fading sparkle in his eyes rekindled as his companion replied irritably

"Then I wish the meddlesome beast had minded its own business,
instead of sending you back here to pull a long face over what I
mean to do in spite of it."
As he spoke he walked up to where the dog Don lay tethered, held a
strip of cotton cloth to its nose, and then muttering viciously—
"Find him, Don, find him!" pressed his finger hastily on the spring of
the dog's collar, and set it free.
The great animal bounded forward. The next instant there was a
howl, a moan, and Don lay dying at Montoro's feet; rather, one
should say, at Montoro's knees, for the young man had sunk on to
them almost as soon as his own fist had fallen with that lightning
stroke, and the same hand that had dealt the death-blow was now
soothing the poor brute's last agonies. It was Montoro de Diego who
had killed it, and yet it was to Montoro's face that the pleading brown
eyes were lifted with their last gaze of affection, and it was Montoro's
hand that the dying tongue licked with the last breath.
"My poor old Don," muttered Montoro huskily, as he tenderly pressed
the side quivering with the death struggle; "poor old Don."
"It's fine for thee to pity the poor brute when it owes its sufferings to
thy malice," exclaimed Don Alonzo furiously, and with fingers on the
hilt of his dagger, as though they itched to lay his companion beside
the animal.
But Diego paid no seeming heed to the show of rage. Maintaining his
kneeling position for a while longer, he replied quietly—
"Yes, it once owed its life to me, and now it owes its death to me,
and better so than it should have been the innocent cause of
suffering to one of our human brethren, for whom the cross rose on
Calvary."
And then he rose from beside the dog's dead body, and turned
slowly away with a saddened face. In spite of its ferocious nature,
the animal had always been most docile with him; and besides, it
had been that oft-felt link with his mother's home. How long ago now
seemed that first day of parting from his country, when Rachel de
Diego's slender fingers had rested for a few moments on the
animal's head. Her son would far rather have a second time
undergone some peril to save its life, than have had to destroy it for
the prevention of a crime.
"Ah, Señor," murmured Bautista, as he crept out on to the verandah
after him a few minutes later. "Ah, Señor, you have saved poor
Guatchi's limbs from being mangled; but I doubt me you have made
an enemy for yourself."
"You were willing to do the same in the same cause, Bautista," was
the answer with a grave smile of approval. "I knew not that thou wast
so staunchly ranged on the side of justice and mercy. Henceforth we
are friends."
The boy sprang forward to clasp the hand held out to him, and said
eagerly—
"To follow in your steps, Señor, I began to remind myself that the
Indians' flesh had feelings like our own, but my past month in the
mines has been a black lesson in horror that I would not repeat to
escape the pains of purgatory. These Indians are tenfold weaker
than we are, and their sufferings are tenfold more, for they have
learnt nothing of manhood to sustain them. You have seen them die
here in the plantations, Señor, and that has roused your pity; but in
those mines it is not that some die, but that none survive. A few days
of that dismal work beneath cuffs and lashes, and their strength is
spent—"
"And then?" came the short query.
"And then," ended the boy with a sort of gasp for breath, "they sink to
the ground, and the brutal kick given to rouse them up to continued
labour, is the accompaniment of their last breath. It is little wonder,
Señor, that I should wish poor Guatchi to get away free, now that he
has escaped such toil alive."
The whole fervour of the boy's susceptible nature was aroused, and
Montoro felt more than ever convinced that he was in the presence
of one whose spirit was akin to his own.
"Hearken, Bautista," he said, after a short pause. "I have within the
past few hours copied out part of a commission against the
miserable inhabitants of this new world, lately granted by our king,
and framed by the greatest divines and lawyers of our old home.
Alonso de Ojeda and Diego de Nicuessa bear drafts of this
commission with them, and be well assured that they will not spare
its execution. But stay; I will read thee the very words themselves,
addressed for peremptory orders to these poor heathen, ignorant of
the very language in which we call upon them to obey our faith and
laws:—'If you will not consent to take our Church for your Church,
the holy father the Pope for your spiritual head, our king for your king
and sovereign lord over your kings and countries, then, with the help
of God, I will enter your country by force; I will carry on war against
you with the utmost violence; I will subject you to the yoke of
obedience; I will take your wives and children and will make them
slaves; I will seize your goods, and do you all the mischief in my
power, as rebellious subjects, who will not submit to their lawful
sovereign. And I protest that all the bloodshed and calamities that
shall follow shall be due to you, and not to us.'"[2]
As Montoro came to the end of his sheet he folded and replaced it in
his pocket, and then, utterly forgetful of his companion in his
reawakened indignation, he wandered away from the verandah, and
betook himself to the simple dwelling of the good clerigo,
Bartholomew de las Casas, who was now finally settled in
Hispaniola, by royal desire, as a missionary to the natives.
"But of what use," he exclaimed this afternoon in sorrowful despair to
his equally weary-hearted visitor, "of what use, Diego, to waste our
time and strength, in trying to teach the sublime truths of religion to
men whose spirits are broken, and their minds weakened by
oppression?"
"Of what use, indeed," assented Montoro with passion, "to try to
teach men to believe in a religion professing itself the religion of love
and mercy, while they are slaves to those calling themselves its
followers, and who are acting at the same time the part of demons!"
"You speak strongly," said the true-hearted, good Christian bishop.
"But verily I cannot say you have not reason. Knowest thou, my
friend, that when first we settled ourselves upon this fertile fragrant
island, not yet fifteen years ago, the inhabitants numbered above
three millions, and now they scarcely amount to fifteen thousand.
Scarcely fifteen thousand!" he repeated slowly, and in awe-struck
tones, as though he scarcely could endure to recall the awful fact to
his own remembrance.
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!

textbookfull.com

You might also like