辅导CS331、辅导MATLAB/Python编程

2023-03-21 辅导CS331、辅导MATLAB/Python编程
CS331 Coursework (MATLAB or Python Programming) Submission Deadline: 31st March 2023 at noon, via Tabula Submission Format:o If you use MALTAB, submit 3 scripts (E1.m, E2.m, E3.m) and 3 files(E1.mlapp, E2.mlapp, E3.mlapp) for app designer.o If you use Python, submit 3 files (E1.ipynb, E2.ipynb, E3.ipynb) andmake sure they run successfully on Google Colab)1. Train feedforward neural networks to emulate five 2-input logic gates (AND, OR, NAND, XOR,IMPLY), respectively. Build a graphical user interface, which a) allows users to select any of theselogic gates from a list box, and b) display the corresponding network diagram (including weightsand biases based on your training) and the truth table of each selected logic gate.(NB: The network diagram of each logic gate should be drawn using MATLAB, with the edgeweights and biases being generated dynamically from your training results. You are not allowedto use third-party software, e.g., MS Paintbrush, to draw these diagrams in a static manner.)(33 marks)2. Train a neural network to recognise a 7x5 matrix display of digital letters (A-Z, a-z) and numerals(0-9), as shown in Figure 1. Build a graphical user interface (GUI), which allows users to enter astring (e.g., “WELCOME”) for testing.Specifically, you are required toa) create a textbox to enter a testing string (e.g. “WELCOME”);b) create a button with caption “Show Original Matrix Display”. When the button is clicked,visualise the original 7x5 matrix display for each character of your typed string;c) create a button with caption “Show Noisy Matrix Display”. When the button is clicked,add 10% noisy pixels at random to each original 7x5 matrix display obtained in step (b)first and then visualise each perturbed 7x5 matrix display after noise is added.d) create a button with caption “Predict Noisy Matrix Display”. When the button is clicked,train your network and label the predicted character for each noisy 7x5 matrix displayobtained in step (c).(NB: This LED display consists of a 7x5 matrix of lights such that, by turning on or off selectedlights, the required character is displayed. This is a generalisation of the 7-segment LED display.)(33 marks)Figure 1 A 7x5 matrix display of digital letters(A-Z, a-z) and numerals (0-9)Figure 2 A 7x5 matrix display7 rows5 columns3. Download DBLP dataset (DBLP.mat) from the module page. The DBLP is a co-authorship graph,consisting of 3823 authors, and their collaborative information. Each node in DBLP denotes anauthor. There is an undirected edge between two authors if they co-authored at least one paper.Build a graphical user interface, which a) shows the names of top-20 most “important” authorsfrom DBLP in a list box, using PageRank measure; and b) allows users to randomly select any ofthem as a query, q, for retrieving the top-10 most “similar” co-authors, x, with respect to query q,using SimRank score s(x, q), and displaying the top-10 “similar” co-authors, x, in another list box.(NB: The structure of DBLP.mat is shown in Figure 3, where “A” is a sparse binary adjacencymatrix. A(i,j)=1 if nodes (authors) i and j have co-authored a paper. “authors” is an“author name” dictionary, where i-th element denotes the author name of node i in the DBLP).Figure 3 Structure of DBLP.mat(33 marks)