📗 Enter your ID (the wisc email ID without @wisc.edu) here: and click (or hit the "Enter" key) 1,2,3,4,5,6,7,8,9,10a95
📗 You can also load from your saved file and click .
📗 If the questions are not generated correctly, try refresh the page using the button at the top left corner.
📗 The due date (hard deadline) is July 6, late submissions to the competitive project components will not be accepted under any circumstances. The remaining assignment can be submitted to earn a maximum of 5 points before August 10 without penalty.
📗 The same ID should generate the same set of questions. Your answers are not saved when you close the browser. You could either copy and paste or load your program outputs into the text boxes for individual questions or print all your outputs to a single text file and load it using the button at the bottom of the page.
📗 Please do not refresh the page: your answers will not be saved.
📗 You should implement the algorithms using the mathematical formulas from the slides. You can use packages and libraries to preprocess and read the data and format the outputs. It is not recommended that you use machine learning packages or libraries, but you will not lose points for doing so.
📗 (Introduction) In this project, you will train a neural network to recognize shapes, in particular, 3D shapes, with possible noise. The neural network should be fully connected with two hidden layers (ReLU activation, a maximum of 1024 units (recommended less than 100 units for performance) in each layer) and input layer with 1024 units, and output layer with 3 units (softmax activation). You can either write your own version of gradient descent, use someone else's code (please give proper attribution) or train the network using a package such as PyTorch, but you should design the network sizes yourself and create your version of the training set.
📗 (Part 1) Given a neural network with random weights, make sure you can make correct predictions on a simple test set.
📗 (Part 2) Train your network to make correct predictions on a simple test set without noise.
The simple test set for Part 1 and Part 2:
(the labels are 100 sphere, 100 cubes, 100 tetrahedrons)
📗 (Competition) Submit your network to compete with other students to get the highest score on some test set. You can also submit three images to include in the test set (perhaps ones your network can predict correctly, but you think other students' networks might not).
Your submission should contain (i) your player name (not necessarily your real name), (ii) your team (0 or 1 or 2), (iii) your network weights, (iv) [optional] your test set, and have the following format in a .txt text file:
➩ Small example:
➩ Large example:
Note: In the examples, the first network has biases and the second does not, in your submission both networks can have biases or not have biases.
If a test item has shape (one-hot encoding) \(y \in \left\{\begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} , \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} , \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} \right\}\) and you are in team (one-hot encoding) \(t \in \left\{\begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} , \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix} , \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} \right\}\), then your prediction \(\hat{y}\) the score is computed as \(\displaystyle\sum_{i=0}^{2} y_{i} \cdot \hat{y}_{i} \cdot \left(t_{i} + 1\right)\), that is:
➩ You get higher score if your network is more certain about the correct prediction.
➩ You get twice the score for predicting your team shape (0 = sphere, 1 = cube, 2 = tetrahedron) correctly.
➩ In case of ties (after rounding), the networks with fewer units will have higher rankings.
You should plan your training set and loss function according to the scoring rule. Your project grade is based on your submission to this assignment (out of 5) plus your ranking within your team (out of 5):
Top 10% gets 5/5 in each team.
Next 10% gets 4/5 in each team.
Next 10% gets 3/5 in each team.
Next 10% gets 2/5 in each team.
Next 10% gets 1/5 in each team.
(The students who do not participate in the competition will be evenly split into each of the three teams with scores of 0s when computing the rankings).
Competition
Item: out of 0
Leader board:
Team:
Networks:
Tests:
You can use the following tool to generate your training set (or create your own training images by drawing similar shapes: must be 32 pixels by 32 pixels grayscale images; the sizes of the shapes will be fixed at radius 1 for the competition):
Create image: (you can rotate and change the camera angle)
Convert to pixels:
Or randomly rotate and convert (max 1000 at a time, could be slow, wait until this number goes down to 1):
You can also control the noise level (0 to 100): (or you can add noise to the images yourself, i.e. randomly change the color of every pixel with a small probability).
📗 [1 points] Enter the feature vector of any three training images, one for each shape (three lines, 1024 numbers on each line, comma separated, rounded to 4 decimal places). Remember to divide the pixel color values by 255 so that all feature values are between 0 and 1.
Hint
📗 Copy and paste three line from your training set.
📗 [1 points] Enter a random set of weights (biases in the last row) of your network in the correct format (three matrices separated by -----, each matrix has rows separated by lines, columns separated by commas, the first matrix should be \(1024 + 1\) by \(h_{1}\), second matrix should be \(h_{1} + 1\) by \(h_{2}\), and the last matrix should be \(h_{2} + 1\) by \(3\), all numbers rounded by 4 decimal places).
Hint
📗 You can use the example network (copying the example is allowed for this question).
You can use the button below to check if your network predictions are correct for the three training images you provided.
📗 [5 points] Use the random network from the previous question on the simple test set from the instructions, and output the predictive probabilities (300 lines, 3 numbers in each line, [probability of "sphere", probability of "cube", probability of "tetrahedron"], rounded to 4 decimal places, comma separated).
📗 [5 points] Calculate the score of your predictions if you are in teams 0, 1 and 2 based on the scoring rule in the instruction (3 numbers, comma separated).
Hint
📗 Sum of scores from each correct predictions: getting a prediction correct for the shape of your team is worth 2 points, and a prediction correct for the shape of the other teams is worth 1 point.
📗 [5 points] Enter the set of weights (biases in the last row) of your network after training on your training set (three matrices separated by -----, each matrix has rows separated by lines, columns separated by commas, the first matrix should be \(1024 + 1\) by \(h_{1}\), second matrix should be \(h_{1} + 1\) by \(h_{2}\), and the last matrix should be \(h_{2} + 1\) by \(3\), all numbers rounded by 4 decimal places).
Hint
📗 Same as Question 2
You can use the button below to check if your network predictions are correct for the three training images you provided.
📗 [15 points] Use the network from the previous question on the simple test set from the instructions, and output the predictive probabilities (300 lines, 3 numbers in each line, [probability of "sphere", probability of "cube", probability of "tetrahedron"], rounded to 4 decimal places, comma separated).
📗 [5 points] Calculate the score of your predictions if you are in teams 0, 1 and 2 based on the scoring rule in the instruction (3 numbers, comma separated).
📗 [1 points] If you are allowed to pick your team, which team would you pick? (1 number, 0 or 1 or 2). Note: if you are planning to participate in the competition, you should pick your team first, then create the training set and decide the network architecture, loss function, and training algorithm.
Hint
📗 The maximum score of the three scores from the previous question.
📗 [1 points] If you are not planning to participate in the competition, enter "0" or "none" for this question to get the point. If you are planning to participate in the competition, attach the text file you are planning to submit to Canvas to make sure if your submission has the correct format.
📗 [1 points] Please enter any comments and suggestions including possible mistakes and bugs with the questions and the auto-grading, and materials relevant to solving the question that you think are not covered well during the lectures. If you have no comments, please enter "None": do not leave it blank.
📗 Please do not modify the content in the above text field: use the "Grade" button to update.
📗 Warning: grading may take around 10 to 20 seconds. Please be patient and do not click "Grade" multiple times.
📗 You could submit multiple times (but please do not submit too often): only the latest submission will be counted.
📗 Please also save the text in the above text box to a file using the button or copy and paste it into a file yourself . You can also include the resulting file with your code on Canvas Assignment CP1.
📗 The competition file should be submitted to the Canvas Assignment CP1 Competition in a text file named "CP1.txt" (please do not use a different file name).
📗 You could load your answers from the text (or txt file) in the text box below using the button . The first two lines should be "##a: 9" and "##id: your id", and the format of the remaining lines should be "##1: your answer to question 1" newline "##2: your answer to question 2", etc. Please make sure that your answers are loaded correctly before submitting them.
📗 Saving and loading may take around 10 to 20 seconds. Please be patient and do not click "Load" multiple times.
📗 No sample solutions will be posted for these assignments.
📗 You are allowed to use code from other people (with their permission) and from the Internet, but you must and give attribution at the beginning of the your code. You are allowed to use large language models such as GPT4 to write parts of the code for you, but you have to include the prompts you used in the code submission. For example, you can put the following comments at the beginning of your code:
% Code attribution: (TA's name)'s A9 example solution.
% Code attribution: (student name)'s A9 solution.
% Code attribution: (student name)'s answer on Piazza: (link to Piazza post).
% Code attribution: (person or account name)'s answer on Stack Overflow: (link to page).
% Code attribution: (large language model name e.g. GPT4): (include the prompts you used).
📗 You can get help on understanding the algorithm from any of the office hours; to get help with debugging, please go to the TA's office hours. For times and locations see the Home page. You are encouraged to work with other students, but if you use their code, you must give attribution at the beginning of your code.