Book Image

Neural Network Programming with Java - Second Edition

By : Fabio M. Soares, Alan M. F. Souza
Book Image

Neural Network Programming with Java - Second Edition

By: Fabio M. Soares, Alan M. F. Souza

Overview of this book

<p>Want to discover the current state-of-art in the field of neural networks that will let you understand and design new strategies to apply to more complex problems? This book takes you on a complete walkthrough of the process of developing basic to advanced practical examples based on neural networks with Java, giving you everything you need to stand out.</p> <p>You will first learn the basics of neural networks and their process of learning. We then focus on what Perceptrons are and their features. Next, you will implement self-organizing maps using practical examples. Further on, you will learn about some of the applications that are presented in this book such as weather forecasting, disease diagnosis, customer profiling, generalization, extreme machine learning, and characters recognition (OCR). Finally, you will learn methods to optimize and adapt neural networks in real time.</p> <p>All the examples generated in the book are provided in the form of illustrative source code, which merges object-oriented programming (OOP) concepts and neural network features to enhance your learning experience.</p>
Table of Contents (19 chapters)
Neural Network Programming with Java Second Edition
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Index

Preface

The life of a programmer can be described as a continual never-ending learning pathway. A programmer always faces challenges regarding new technologies or new approaches. Generally, during our lives, although we become used to repeated things, we are always subjected to new things. 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 suggest 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 simple language.

What this book covers

Chapter 1, Getting Started with Neural Networks, introduces neural networks concepts and shows the very basic neuron structures (Single Layer Perceptrons, Adaline), activation functions, weights, and learning algorithms. Besides, this chapter shows the process of creating basic neural networks in Java from start to finish.

Chapter 2, Getting Neural Networks to Learn, presents the details of the neural network learning process. Useful concepts, such as training, test, and validation are introduced. We show how to implement training and validation algorithms. This chapter also shows methods for error evaluation.

Chapter 3, Perceptrons and Supervised Learning, gets you acquainted with perceptrons and the supervised learning features. We present training algorithms for these types of Neural Network. The reader will learn how to implement these features in Java.

Chapter 4, Self-Organizing Maps, introduces unsupervised learning with self-organizing maps, namely the Kohonen neural network, and their applications, especially with classification and clustering problems.

Chapter 5, Forecasting Weather, covers one practical problem using neural networks, which is forecasting weather. You will be presented with a time series dataset of historical weather records from different regions, and learn how to apply preprocessing before presenting them to neural networks.

Chapter 6, Classifying Disease Diagnosis, introduces a classification problem, which is also encompassed in supervised learning. Using patient records data, a neural network is built to act as an expert system, being capable of giving a diagnosis based on patients, symptoms.

Chapter 7, Clustering Customer Profies, will teach you about clustering using neural networks, as well as applying unsupervised learning algorithms to achieve that goal.

Chapter 8, Text Recognition, presents another common task involving neural networks, optical character recognition (OCR), which is a very useful and impressive task that really shows the powerful learning skill neural networks have.

Chapter 9, Optimizing and Adapting Neural Networks, demonstrates techniques that help optimizing neural networks, such as input selection, better dataset separation into training, validation and test, as well as data filtering and the choice of number of the hidden neurons.

Chapter 10, Current Trends in Neural Networks, will make you aware of the current state of the art in the field of neural networks, enabling you to understand and design new strategies to apply to more complex problems.

Appendix A, Setting up Netbeans Environment, This appendix shows a step-by-step procedure for the reader to set up the development environment for the Netbeans IDE.

Appendix B, Setting up Eclipse Environment, This appendix shows a step-by-step procedure for the reader to set up your development environment if you want to use Eclipse IDE.

These Appendices are not present in the book but are available for download at the following link: https://www.packtpub.com/sites/default/files/downloads/Neural_Network_Programming_with_Java_SecondEdition_Appendices.pdf

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 from their websites.

Who this book is for

This book is for Java developers who want to know how to develop smarter applications using the power of neural networks. Those who deal with a lot of complex data and want to use it efficiently in their day-to-day apps will find this book quite useful. Some basic experience with statistical computations is expected.

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: "Layers are initialized and calculated as well as the neurons; they also implement the init() and calc() methods."

A block of code is set as follows:

public abstract class NeuralLayer {
  protected int numberOfNeuronsInLayer;
  private ArrayList<Neuron> neuron;
  protected IActivationFunction activationFnc;
  protected NeuralLayer previousLayer;
  protected NeuralLayer nextLayer;
  protected ArrayList<Double> input;
  protected ArrayList<Double> output;
  protected int numberOfInputs;
}

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "After selecting the parameters, the training begins by clicking the Start Training button."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

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 , 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 for this book from your account at http://www.packtpub.com. 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.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Neural-Network-Programming-with-Java-SecondEdition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

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.

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 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 , and we will do our best to address the problem.