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

Time to see the learning in practice!


Let's work on a very simple yet illustrative example. Suppose you want a single neuron neural network to learn how to fit a simple linear function such as the following:

This is quite easy even for those who have little math background, so guess what? It is a nice start for our simplest neural network to prove its learning ability!

Teaching the neural network – the training dataset

We;re going to structure the dataset for the neural network to learn using the following code, which you can find in the main method of the file NeuralNetDeltaRuleTest:

Double[][] _neuralDataSet = {
  {1.2 , fncTest(1.2)}
 ,   {0.3 , fncTest(0.3)}
 ,   {-0.5 , fncTest(-0.5)}
 ,   {-2.3 , fncTest(-2.3)}
 ,   {1.7 , fncTest(1.7)}
 ,   {-0.1 , fncTest(-0.1)}
 ,   {-2.7 , fncTest(-2.7)}  };
int[] inputColumns = {0};
int[] outputColumns = {1};
NeuralDataSet neuralDataSet = newNeuralDataSet(_neuralDataSet,inputColumns,outputColumns);

The funcTest function is defined as the function...