O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Neural Network Programming with Java - Second Edition

Book Description

Create and unleash the power of neural networks by implementing professional Java code

About This Book

  • Learn to build amazing projects using neural networks including forecasting the weather and pattern recognition
  • Explore the Java multi-platform feature to run your personal neural networks everywhere
  • This step-by-step guide will help you solve real-world problems and links neural network theory to their application

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.

What You Will Learn

  • Develop an understanding of neural networks and how they can be fitted
  • Explore the learning process of neural networks
  • Build neural network applications with Java using hands-on examples
  • Discover the power of neural network’s unsupervised learning process to extract the intrinsic knowledge hidden behind the data
  • Apply the code generated in practical examples, including weather forecasting and pattern recognition
  • Understand how to make the best choice of learning parameters to ensure you have a more effective application
  • Select and split data sets into training, test, and validation, and explore validation strategies

In Detail

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.

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.

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.

Style and approach

This book takes you on a steady learning curve, teaching you the important concepts while being rich in examples. You’ll be able to relate to the examples in the book while implementing neural networks in your day-to-day applications.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased 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 code file.

Table of Contents

  1. Neural Network Programming with Java Second Edition
    1. Table of Contents
    2. Neural Network Programming with Java Second Edition
    3. Credits
    4. About the Authors
    5. About the Reviewer
    6. www.PacktPub.com
      1. eBooks, discount offers, and more
        1. Why subscribe?
    7. Customer Feedback
    8. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    9. 1. Getting Started with Neural Networks
      1. Discovering neural networks
      2. Why artificial neural networks?
        1. How neural networks are arranged
        2. The very basic element – artificial neuron
        3. Giving life to neurons – activation function
        4. The flexible values – weights
        5. An extra parameter – bias
        6. The parts forming the whole – layers
        7. Learning about neural network architectures
        8. Monolayer networks
        9. Multilayer networks
        10. Feedforward networks
        11. Feedback networks
      3. From ignorance to knowledge – learning process
      4. Let the coding begin! Neural networks in practice
      5. The neuron class
      6. The NeuralLayer class
      7. The ActivationFunction interface
      8. The neural network class
      9. Time to play!
      10. Summary
    10. 2. Getting Neural Networks to Learn
      1. Learning ability in neural networks
        1. How learning helps solving problems
      2. Learning paradigms
        1. Supervised learning
        2. Unsupervised learning
      3. The learning process
        1. The cost function finding the way down to the optimum
        2. Learning in progress - weight update
        3. Calculating the cost function
        4. General error and overall error
        5. Can the neural network learn forever? When is it good to stop?
      4. Examples of learning algorithms
        1. The delta rule
        2. The learning rate
        3. Implementing the delta rule
        4. The core of the delta rule learning - train and calcNewWeight methods
        5. Another learning algorithm - Hebbian learning
        6. Adaline
      5. Time to see the learning in practice!
        1. Teaching the neural network – the training dataset
      6. Amazing, it learned! Or, did it really? A further step – testing
        1. Overfitting and overtraining
      7. Summary
    11. 3. Perceptrons and Supervised Learning
      1. Supervised learning – teaching the neural net
        1. Classification – finding the appropriate class
        2. Regression – mapping real inputs to outputs
      2. A basic neural architecture – perceptrons
        1. Applications and limitations
        2. Linear separation
        3. The XOR case
      3. Multi-layer perceptrons
        1. MLP properties
        2. MLP weights
        3. Recurrent MLP
        4. Coding an MLP
      4. Learning in MLPs
        1. Backpropagation algorithm
        2. The momentum
        3. Coding the backpropagation
        4. Levenberg-Marquardt algorithm
        5. Coding the Levenberg-Marquardt with matrix algebra
        6. Extreme learning machines
      5. Practical example 1 – the XOR case with delta rule and backpropagation
      6. Practical example 2 – predicting enrolment status
      7. Summary
    12. 4. Self-Organizing Maps
      1. Neural networks unsupervised learning
      2. Unsupervised learning algorithms
        1. Competitive learning
        2. Competitive layer
      3. Kohonen self-organizing maps
        1. Extending the neural network code to Kohonen
        2. Zero-dimensional SOM
        3. One-dimensional SOM
        4. Two-dimensional SOM
        5. 2D competitive layer
        6. SOM learning algorithm
        7. Effect of neighboring neurons – the neighborhood function
        8. The learning rate
        9. A new class for competitive learning
        10. Visualizing the SOMs
        11. Plotting 2D training datasets and neuron weights
        12. Testing Kohonen learning
      4. Summary
    13. 5. Forecasting Weather
      1. Neural networks for regression problems
      2. Loading/selecting data
        1. Building auxiliary classes
        2. Getting a dataset from a CSV file
        3. Building time series
        4. Dropping NaNs
        5. Getting weather data
        6. Weather variables
      3. Choosing input and output variables
      4. Preprocessing
        1. Normalization
        2. Adapting NeuralDataSet to handle normalization
        3. Adapting the learning algorithm to normalization
        4. Java implementation of weather forecasting
        5. Collecting weather data
        6. Delaying variables
        7. Loading the data and beginning to play!
        8. Let's perform a correlation analysis
        9. Creating neural networks
        10. Training and test
          1. Training the neural network
          2. Plotting the error
        11. Viewing the neural network output
      5. Empirical design of neural networks
        1. Designing experiments
        2. Results and simulations
      6. Summary
    14. 6. Classifying Disease Diagnosis
      1. Foundations of classification problems
        1. Categorical data
        2. Working with categorical data
      2. Logistic regression
        1. Multiple classes versus binary classes
        2. Confusion matrix
        3. Sensitivity and specificity
        4. Implementing a confusion matrix
      3. Neural networks for classification
      4. Disease diagnosis with neural networks
        1. Breast cancer
        2. Diabetes
      5. Summary
    15. 7. Clustering Customer Profiles
      1. Clustering tasks
        1. Cluster analysis
        2. Cluster evaluation and validation
        3. Implementation
        4. External validation
      2. Applied unsupervised learning
        1. Kohonen neural network
      3. Profiling
        1. Pre-processing
        2. Implementation in Java
        3. Card – credit analysis for customer profiling
        4. Product profiling
        5. How many clusters?
      4. Summary
    16. 8. Text Recognition
      1. Pattern recognition
        1. Defined classes
        2. Undefined classes
      2. Neural networks in pattern recognition
        1. Data pre-processing
        2. Text recognition (optical character recognition)
        3. Digit recognition
        4. Digit representation
        5. Implementation in Java
        6. Generating data
        7. Neural architecture
        8. Experiments
        9. Results
      3. Summary
    17. 9. Optimizing and Adapting Neural Networks
      1. Common issues in neural network implementations
      2. Input selection
        1. Data correlation
        2. Transforming data
        3. Dimensionality reduction
        4. Data filtering
        5. Cross-validation
        6. Structure selection
      3. Online retraining
        1. Stochastic online learning
        2. Implementation
        3. Application
      4. Adaptive neural networks
        1. Adaptive resonance theory
        2. Implementation
      5. Summary
    18. 10. Current Trends in Neural Networks
      1. Deep learning
      2. Deep architectures
        1. How to implement deep learning in Java
          1. Hybrid systems
        2. Neuro-fuzzy
        3. Neuro-genetic
      3. Implementing a hybrid neural network
      4. Summary
    19. A. References
      1. Chapter 1: Getting Started with Neural Networks
      2. Chapter 2: Getting Neural Networks to Learn
      3. Chapter 3: Perceptrons and Supervised Learning
      4. Chapter 4: Self-Organizing Maps
      5. Chapter 5: Forecasting Weather
      6. Chapter 6: Classifying Disease Diagnosis
      7. Chapter 7: Clustering Customer Profiles
      8. Chapter 8: Text Recognition
      9. Chapter 9: Optimizing and Adapting Neural Networks
      10. Chapter 10: Current Trends in Neural Networks
    20. Index