Maximum mark: 50 (50% of the whole module)
Note: Please do not copy from another student’s submission. All the other submissions are in the
system and Turnitin will check for similarities. Coursework will be routinely checked for academic
misconduct. Your submission must be your own work. Please read the Student Handbook to ensure
that you know what this means.
All functions in the DEAP library or PyTorch / NumPy / SymPy are allowed to be used for this
coursework, and any other libraries within reason (e.g. for visualisation).
Please include your full name, URN and email address in the report. Use the IEEE template for
Your report should be single-spaced, double-column (but tables or figures are allowed to span two
columns if you wish).
Submit a single PDF file. The code you used to produce the results should be appended at the end of
the report (appendix). The appendix may be in single column format. Include a heading for each
program in the appendix, i.e. one program for Q1.1, one program for Q1.2, etc. Everything should be
pasted into one document, do not submit code as separate files.
The purpose of the coursework is to enable you to gain hands-on programming skills for using
evolutionary algorithms to solve optimisation and learning problems.
Explain important hyperparameter settings you used, or any important changes to code
that you needed to make.
1. For the following function:
f (x1, x2) = 2 + 3.9 x1
– 2.1 x1
6 + x1 x2 – 3.5 (x2 – 0.04)
2 + 3.9 x2
1.1 Use a genetic algorithm to find the minimum of the function. Use 30 bits per chromosome
and allow x1 and x2 to range from -5 to 5. Other hyperparameters may be the same as the
example from Week 2. In your report you must show:
a) The fitness of the fittest individual after 100 generations, and its decoded values for
x1 and x2. Remember that if you are using the inverse of the fitness within the
algorithm then you will need to convert this back to actual function value. [5 marks]