辅导案例-CSC372

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
Developing Optimisers in Python
Coursework Assignment (2020-21)
Module: Optimisation.
Module code: CSC372-M72.
Module coordinator: Dr Alma Rahat ([email protected]).
Allocated marks: 20% of the total module marks.
Submission deadline: 11:00 on 30 November 2020 (Monday).
Submission site: canvas.swansea.ac.uk
Tasks
Consider the following specification for an optimisation problem.
We are to optimise the weight of a tension or compression spring. There are three variables
that determine the weight: the diameter of the wire (x1), the mean of the diameter of coil
(x2) and the number of active coils (x3). Therefore, any arbitrary decision vector has three
components x = (x1, x2, x3)> ∈ X . The feasible space X is defined by four constraints and
bounds on x. The problem is defined as:
min
x∈X
f(x) = x21x2(2 + x3), (1)
where the feasible space X is subject to:
g1(x) = 1− x
3
2x3
71785x41
≤ 0, (2)
g2(x) =
4x22 − x1x2
12566(x2x31 − x41)
+
1
5108x21
− 1 ≤ 0, (3)
g3(x) = 1− 140.45x1
x22x3
≤ 0, (4)
g4(x) =
x1 + x2
1.5
− 1 ≤ 0, (5)
and with bounds
x1 ∈ [0.05, 2], (6)
x2 ∈ [0.25, 1.3], (7)
x3 ∈ [2, 15]. (8)
Now, you have the following tasks.
1. Implement all the functions f(x) and gi(x);∀i ∈ [1, 4] independently, where each function
takes at least a Numpy array x. Each function shouold have an independent counter
that represents how many times a respective function has been called (or in other words
evaluated).
2. Implement the Random Search (RS) method discussed in the lectures that can use the
functions defined above and return an approximation of the optimum.
3. Implement a stochastic global optimisation algorithm of your choice (selected from the
algorithms covered in the course) that can use the functions defined above and return an
approximation of the optimum.
4. For 21 repetitions of each of the algorithms implemented in 2 and 3, compare and com-
ment on the performances of these optimisers. The number of function evaluations on
f(x) that you are allowed at each instance of an optimisation is 3000 at most.
In this assignment, you must use Python 3.x to develop your code in Jupyter notebook.
Please note you are allowed to use basic and advanced Python modules, such as Numpy, Scipy,
Matplotlib, etc. However, the core of the algorithmic implementations must be your own: for
instance, you cannot just use a module that already implements the algorithm you selected. If
you are in doubt, please feel free to contact the module coordinator for clarifications.
Submission
You are required to submit the following on Canvas.
Code A single Jupyter notebook file (with the format XXXXXXX.ipynb1). You must ensure
that all the results are pre-generated and repeatable, otherwise you may lose marks.
Documentation Within the notebook, at the top before your code, please provide answers to
the following questions. The maximum word limit for your answer for each question is
given at the right.
1. Which stochastic optimiser did you choose (for Task 3)? [100 words]
2. Why did you choose this optimiser? [100 words]
3. What constraint handling method(s) are you using and why? [250 words]
Assessed Learning Outcomes (ALOs)
The assessed learning outcomes of this assignment are as follows.
ALO1 Demonstrate systematic understanding of fundamental concepts of optimisation prob-
lems and algorithms.
ALO2 Propose an appropriate method to solve an optimisation problem.
ALO3 Develop appropriate software for solving an optimisation problem.
ALO4 Critically evaluate performance of multiple competing optimisers, and communicate
analysis.
1Please use your student ID to replace XXXXXXX in the name of the document.
Marking Criteria
Below we provide a table describing the mark allocation. Please note that the following alloca-
tion is indicative only, and may change following moderation.
Topic Expectation
Indicative
percentage of
marks (%)
Problem implementation
(Task 1, ALO1)
Correctly implement all the functions. 20%
Implementation of RS
(Task 2, ALO3)
A flexible implementation of RS that can be
used for constrained problems. It should
work with a random seed such that results
may be repeated exactly.
15%
Proposing an algorithm,
and implementation (Task
3, ALO2, ALO3)
A flexible implementation of an optimiser
of your choice that can be used for different
problems. It should work with a random
seed such that results may be repeated ex-
actly.
30%
Using appropriate con-
straint handling technique
(Tasks 2 and 3; ALO2)
Use contemporary methods for RS and the
optimiser of your choice. 10%
Performance evaluation
(Task 4,ALO4)
A boxplot showing performances of the
competing optimisers over 21 repetitions.
Statistical comparison of final results, and
appropriate comments on significance.
20%
Document structure and
code quality (ALO4)
The document follows a sound logical
structure, and the code is written following
standard practices.
5%
You will be marked in each category based on the level at which you meet the expectations
described in the table above. The level descriptions are given below.
Excellent Very good Good Adequate Unacceptable
70− 100% 60− 69% 50− 59% 40− 49% 0− 39%
Please note that we may hold vivas as part of the assessment process. If you are invited for
a viva, you will be expected to download your notebook from Canvas, demonstrate function-
alities, and answer questions about your submission.
This is an individual coursework, and please adhere to the guidelines about academic
misconduct which can be found in the following link:
myuni.swansea.ac.uk/academic-life/academic-misconduct/
Please remember that failing to adhere to the guidelines may have severe consequences,
including withdrawal from the university.

欢迎咨询51作业君
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468