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

  Complimentary base pairing in dna replication

What does it mean when we say that the two strands of DNA in the double helix are antiparallel?

  Scientific and technical concepts related to dna

What alternative methods might be employed to address the same questions that can be answered via DNA testing?

  This video reviews the prevalence

This video reviews the prevalence of Autistic Spectrum Disorder and the intervention methods that the parents can use to help in the assessment process. This video reviews the Autistic Spectrum Disorder and the growing prevalence of this disorder.

  An effective manager accepts the political nature of

an effective manager accepts the political nature of organizations. power tactics are used to translate power bases

  Discuss the relevance of the term social citizenship

Discuss the challenges to sustainability of pensions in Mauritius and what can be done to address the challenges Discuss the relevance of the term social citizenship to the provision of welfare state

  A local health policy issue

Discuss the implications of the selected issue on the community as a whole.Who all are affected by the policy?

  Calculate the center lines and the upper and lower control

Calculate the center lines and the upper and lower control limits for the average

  Choose one of the six basic emotions

Choose one of the six basic emotions (remember the 6 are: surprise, anger, fear, disgust, sadness, and happiness) and describe it from a biological, psychological and environmental perspective

  Analyze the ways in which globalization and the spread of ma

Analyze the ways in which globalization and the spread of market economies have changed gender roles in different societies. Give several examples that explain how you see your role in society changing in the future.

  What is the main theme of the righteous mind

What is the main theme of The Righteous Mind by Jonathan Haidt? What are 2 to 3 similarities between The Righteous Mind and Sam Harris' book Free Will?

  Comprehensive attack to reduce prejudice

Consider the comment on page 48 of the Schaefer text, paragraph 6, lines 1-3 which indicates that education does reduce prejudice, at least temporarily. Overall, Schaefer (2012) indicates that education does help improve racial tolerance (pg...

  Norm violation then address each of the items

You are then to write at LEAST one page that addresses each of the items above. In addition, you should describe what you did.  Tell me the story of your norm violation, then address each of the items above.

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