Evolving a neural network to fit a function

Assignment Help Science
Reference no: EM13920917

This assignment involves exploring the properties and adding some functionality to an evolving Artificial Neural Network (ANN). The supervised learning system evolves the weights for an ANN using a generational evolutionary model. The goal of the evolving ANN is to fit a function of the form f(x).

1. Download from Blackboard (Assignments->Assn3) the assn3.zip file, and extract the files into a folder. 2. Startup Eclipse and import the project named EvolAnn. You will also need to fix the external jar file references – remove the old ones and add the external jar files found under the lib folder (weka.jar,jcommon-1.0.12.jar, jfreechart-1.0.9.jar, junit.jar, servlet.jar).

There are a number of packages with this project: Package ann: This package contains the neural network classes that implement a simple feed-forward neural network with a single hidden layer. The structure of this package follows the neural network structure described at the ai-junkie website. Package evolve: This package contains a definition of an individual and the population structure for the evolving population. You will have to write some additional methods for these classes. Package utilities: This package contains an ObjectCloner class, which does a deep copy of a class structure (very useful if you want to make a copy of an object), and a random number generator (the Mersenne Twister) that is accessed by calling the static declaration of this class (e.g. Util.rnd.nextDouble(), etc.). This approach allows a single random generator to be accessed by many classes.

Package main: This package contains the main window (you start the program by highlighting Mainwin and running as a Java application), and the thread (EvolveThread) used to control and display the evolving population.

1. Highlight Mainwin and run as a Java application. 2. Click on “Load Data”, and select the file data/reg1.arff. 3. Click on “Initialise” – this creates the initial random population and displays the best individual, its prediction, the population current fitness values and the weights of the best individual. 4. Click “Start” – the system begins evolving the population – note that the “Pause” button allows the system to be stopped/started. The model uses a population of individuals, each representing the weights for a neural network (ANN) with architecture (1:N:1), where N = number of hidden nodes. The ANN weights are evolved over time to try and fit the loaded function. You will notice that over time (top right graph) the best fitness gradually decreases (the fitness measure is the RMSE, so zero is a perfect match, and fitness is always ≥ 0). Note also that, although there are settings for crossover probability, THIS IS CURRENTLY NOT IMPLEMENTED. Hence the population is just using mutation to create variation in the population. Try loading in data/reg2.arff – this is a more complex function, however given enough time the system will evolve a near perfect match to this function!

Assignment Exercises

1. Examine the double[] update(double in[]) method in the SNeuralNet class (in the ann package) and answer the following question: Explain why for this problem it is necessary to use a linear function (i.e. just pass the final summed weights through to the output) for the output layer of the ANN, rather then the sigmoid function (that is used for the input and hidden node layers).  

2. The current model uses tournament selection, with tournament size as defined by the field on the Main window (i.e. defaults to 5). Run the model (load in data reg1.arff) with tournament size = 1 and the defaults (i.e. mutation prob=0.1, mutation dev = 0.5, no elitism). Explain the behaviour that you observe. Now set elitism on. Explain the behaviour.

3. Set tournament size to 2, mutation probability to 0.0, no elitism, and run the model. Provide an explanation for the behaviour you observe. Now set tournament size to 1 and explain the behaviour that you now observe, ensuring that you relate this back to the previous behaviour.

4. Examine the class EvolveThread and the method run(). This method repeatedly calls the population to evolve the next generation of individuals. Note that if fps is true (indicating that fitness prop. selection is to occur) the method current_pop = current_pop.evolve_generation(data) is called. Currently this method just makes a copy of the current population. Your task is to implement a fitness proportionate selection model in this method. Note that since lower fitness is better (since it measures the RMSE against the training data) you will need to adjust the fitness so that fitter individuals have larger values, prior to constructing the proportionate fitness values. Include a copy of your code for this method in your write-up and an explanation of your implementation

5. Examine the class Individual (which represents an individual in the population). The method for crossover is defined as: public void crossover(double crossprob, Individual p2) The interpretation for this method is that “this” individual is to be crossed over with Individual p2 with probability crossprob (i.e. crossprob is the probability that the crossover will occur). Use one-point crossover to mix the weights of “this” individual with p2. Note that you also have to choose randomly whether to copy the first section of the weights from p2, or the second, into “this” individual. HINT: Examine the mutation method for clues. Include a copy of your code in your write-up and a brief explanation of your implementation

6. Assume now that you want to create a crossover method using uniform crossover. Give a pseudo-code description (no implementation) for the method: public void crossover(double crossprob, double locusprob, Individual p2) where crossprob is as the previous crossover, and locusprob is the probability that any locus (weight) from p2 is copied to “this” individual.

7. Describe and explain the behaviour of the model when only crossover is used (no mutation) and no elitism. Use the following settings: Population size of 1000, mutation prob = 0.0, tournament size = 2, Crossover Prob = 0.1

8. Crossover as a mixing operation for Artificial Neural Networks (ANNs) Consider the general operation of crossover when making offspring for individuals that represents the weights for an ANN. Make an argument for why crossover may not be an appropriate way to evolve neural networks (or argue why it is a reasonable approach if you prefer). You will need to consider what the weights are representing and the relationship between different individuals in the population.

9. A Co-evolution System Design. Consider the design for a co-evolutionary system to model predator-prey dynamics. Assume that you will use a functional language to describe the behaviour for the predators and preys and that the individuals will live on a 2-dimensional torus. Each individual has a location (x,y) and can sense their food (predator) or enemy (prey), as well as move, turn, etc. Describe a simple language for the predator and prey individuals and how you would measure the fitness. What type of behaviour might you expect to see from your model? What problems would have to be addressed for the model to produce interesting dynamics? Ensure you include all references to work that you have used to support your answer. 

Reference no: EM13920917

Questions Cloud

Determine which location has the highest composite : Determine which location has the highest composite score.
Which location alternative should be chosen : Using the following factor ratings, determine which location alternative (A, B, or C) should be chosen on the basis of maximum compositescore.
For each of the four types of organizations shown : For each of the four types of organizations shown, rate the importance of each factor in terms of making location decisions using L low importance, M moderate importance, and H highimportance.
Which location will yield the greatest profit : Which location will yield the greatest profit if monthly demand is (1) 200 cars? (2) 300 cars? At what volume of output will the two sites yield the same monthly profit?
Evolving a neural network to fit a function : EVOLVING A NEURAL NETWORK TO FIT A FUNCTION,  onsider the design for a co-evolutionary system to model predator-prey dynamics. Assume that you will use a functional language to describe the behaviour for the predators and preys and that the individua..
A capital expenditure decision : Berick Ltd: A Capital Expenditure Decision, Berick Ltd is a relatively small engineering company that manages to compete effectively with larger companies by adapting to changing market requirements and specialising in innovative products with limite..
Stanton argues that media relations is an industry : This essay needs to make a scholarly argument, properly referenced, discussing the role of evaluation in the Media Relations field and the various methods of evaluating campaigns. Whenever possible, refer to your own campaign as a case study.
Company has the opportunity : A company has the opportunity to sell 1,000 extra units of product to a new customer outside the US. The price at which this sale can be made is $95 per unit. The normal price is $125. The standard cost is $75 of variable costs plus $25 of fixed cost..
Examines the basic positions of each of the five religious : Write an essay of 1,000 words that examines the basic positions of each of the five religious traditions considering these human questions In your essay, address the following questions: How does each (Buddhism, Judaism, Christianity, Islam, and Hind..

Reviews

Write a Review

Science Questions & Answers

  Estimate the difference between the yearly incomes

In order to estimate the difference between the yearly incomes of marketing managers in the east and the west, the following information was gathered:

  What do you think accounts for the rise of conspiracy

what do you think accounts for the rise of conspiracy theories that are offered as explanations for the assassinations

  Summarize levinson psychosocial theory of adult personality

Summarize Levinson's psychosocial theory of adult personality development, including how it applies to both men's and women's lives and their limitations.

  Nutrition, health, and safety issues

Communicable disease prevention: A teacher who does not wash her hands after helping children in the bathroom Describe two to three strategies to address this nutrition, health, or safety concern.

  Influentcial theorist in psychology as a science

Who is the most influentcial theorist in psychology as a science

  How you will apply each type of research methodology at work

Complete a intro where you compare and contrast quantitative and qualitative research methodologies. Summarize intro discussing how you will apply each type of research methodology at work?

  Environmental risks and opportunities in business strategy

An introduction that addresses the components of your green business strategy. Short-term actions (understanding environmental risks and opportunities):

  There are many factors influencing the increasing demand

there are many factors influencing the increasing demand for long-term care services in the united states. select two

  Types of safety and health issues

Your supervisor has removed the tag-out guards on a machine that is in need of repair in order to increase output. What types of safety and health issues do you think can arise from this situation?

  Which dsm-5 disorder matches the symptoms abby is reporting

Which DSM-5 disorder matches the symptoms Abby is reporting?

  Developing country, and discuss the fundamental action

Select one (1) developing country, and discuss the fundamental actions that the leadership of the selected country is-or is not-taking to improve the living standards of its people. Next, using this same country, cite one (1) specific example of prog..

  What is the mean and standard deviation for preoperative

What is the mean and standard deviation for preoperative T score for CVLT Acquisition?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd