logo
  • userLoginStatus

Welcome

Our website is made possible by displaying online advertisements to our visitors.
Please disable your ad blocker to continue.

Current View

Computer Engineering - Machine Learning

Full exam

DIPARTIMENTO DI ELETTRONICA, INFORMAZIONE E BIOINGEGNERIA Politecnico di Milano Machine Learning (Code: 097683)August 30, 2023 Surname: Name: Student ID: Row: Column:Time:2hoursMaximumMarks:33 ˆThe following exam is composed of8 exercises(one per page). The first page needs to be filled with yourname, surname and student ID. The following pages should be used only in the large squarespresent on each page. Any solution provided either outside these spaces orwithout a motivationwill not be considered for the final mark. ˆDuring this exam you arenot allowed to use electronic devices, such as laptops, smartphones, tablets and/or similar. As well, you are not allowed to bring with you any kind of note, book, written scheme, and/or similar. You are also not allowed to communicate with other students during the exam. ˆThe first reported violation of the above-mentioned rules will be annotated on the exam and will be considered for the final mark decision. The second reported violation of the above-mentioned rules will imply the immediate expulsion of the student from the exam room and theannulment of the exam. ˆYou are allowed to write the exam either with a pen (black or blue) or a pencil. It is your responsibility to provide a readable solution. We will not be held accountable for accidental partial or total cancellation of the exam. ˆThe exam can be written either inEnglishorItalian. ˆYou are allowed to withdraw from the exam at any time without any penalty. You are allowed to leave the room not early than half the time of the duration of the exam. You are not allowed to keep the text of the exam with you while leaving the room. ˆThree of the points will be given on the basis on how quick you are in solving the exam.If you finish earlier than 30 min before the end of the exam you will get 3 points, if you finish earlier than 20 min you will get 2 points and if you finish earlier than 10 min you will get 1 point (the points cannot be accumulated). ˆThe box on Page 10 can only be used to complete the Exercises 7, and/or 8.Ex. 1Ex. 2Ex. 3Ex. 4Ex. 5Ex. 6Ex. 7Ex. 8TimeTot. / 7/ 7/ 2/ 2/ 2/ 2/ 4/ 4/ 3/ 33 Student’s name: Please go on to the next page. . . Computer Science Computer Science — Machine Learning Page 2 of 10 Exercise 1 (7marks) Describe and compare the Monte Carlo and Temporal Difference approaches to policy evaluation.Student’s name: Please go on to the next page. . . Computer Science Computer Science — Machine Learning Page 3 of 10 Exercise 2 (7marks) Describe the role of regularization in managing the bias-variance trade-off. Discuss the difference between L1 and L2 regularization techniques and their respective effects on model complexity and feature selection.Student’s name: Please go on to the next page. . . Computer Science Computer Science — Machine Learning Page 4 of 10 Exercise 3 (2marks) Consider the following snippet of code: 1 Q = np . z e r o s ( nS*nA ) 2 Qo l d = np . o n e s ( nS *nA ) 3 4 p i = np . z e r o s ( ( nS , nS*nA ) ) 5f o rsi n range( nS ) : 6 p i [ s , s*nA : ( s +1)*nA ] = 1 / nA 7 8w h i l enp .any(Q != Qo l d ) : 9 Qo l d = Q 10 Q = ( np . e y e ( nS*nA )=gamma*Ps a s @ p i ) @ Rs a 11 p i = np . z e r o s ( ( nS , nS*nA ) ) 12f o rsi n range( nS ) : 13 g a = np . argmax (Q [ s*nA : ( s +1)*nA ] ) 14 p i [ s , s*nA+g a ] = 1 1.What algorithm is the snippet of code above implementing? What problem is it trying tosolve? 2.Is code snippet above correct? If not, list the mistakes and provide a fix for each of them. 3.Is thewhileloop guaranteed to stop after a finite number of iterations (ifgamma