Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Thank you very much... In this homework, you are supposed to implement a dot product function for matrix multiplication and a function to transform given

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedThank you very much...

In this homework, you are supposed to implement a dot product function for matrix multiplication and a function to transform given values of a list. Input will be your student number which consists of 11 integers and this information will be held in a list where each digit of your student number is an element. For example; for a student number 11070001026, matrix is defined as follows; input [[1, 1,0, 7,0, 0, 0,1,0,2,61] which has a shape of (1,11), interpreted as 1 row and 11 columns. We have given you another matrix, as follows; w [0.03370361335647359], [0.07661115022886011], [0.04666099316268933, 0.0038889918178373803], [0.08421628276143776], [0.011537130067313111], 0.10048178370703198], 0.07406232623223129], [0.003752479172986443], [0.038102552367237044] 0.029275344822365088] In this task you will shift your input student number 1 element to left each time for 11 times. After each shift you will calculate dot product of it with the w that has given to you For example: For each shift, input matrix looks like as following after each shift, IMPORTANT NOTE: You should do the shift operation on input list programmatically! Not by hand input [ [1, 1, 0, 7, 0, 0, 0, 1, 0, 2, 6]] input [ [1, 0,7, 0, 0, 0, 1, 0, 2, 6,1]] input [ [0, 7, 0, 0, 0, 1, 0, 2, 6, 1,1]] input [ [7, 0, 0, 0, 1, 0, 2, 6, 1, 1, 0]] input [ [0, 0, 0, 1, 0, 2, 6, 1, 1, 0, 7]] input [ [0, 0, 1, 0, 2, 6,1, 1, 0, 7, 0]] input [ [0, 1, 0, 2, 6,1,1, 0, 7, 0, 0] ] input [ [1, 0, 2, 6,1,1, 0, 7, 0, 0, 0]] input [ [0, 2, 6,1,1, 0, 7, 0, 0, 0, 1]] input [2, 6,1,1, 0,7, 0, 0, 0, 1, 0]] input [ [6, 1,1,0,7, 0, 0, 0, 1, 0, 2]] After a dot product, you should have calculated a single floating point value, for this student number, it looks like as follows Raw Output for shift 1: 0.463457 Raw Output for shift 2: 0.726208 Raw Output for shift 3: 0.785833 Raw Output for shift 4: 1.007334 Raw Output for shift 5: 0.912596 Raw Output for shift 6: 0.725578 Raw Output for shift 7: 0.727973 Raw Output for shift 8: 0.764549 Raw Output for shift 9: 1.253941 Raw Output for shift 10: 0.696487 Raw Output for shift 11:0.977311 However, for each shift you should use outfunction to calculate a single value according to a equation, which is; IMPORTANT NOTE: You are responsible to implement outfunction given in the template 1 +e-x Where x is the input to function and y is the output of the function. If you apply this function to each output of the dot product with our Raw Outputs which we've previously mentioned, going to transform to this; Output for shift 1: 0.613834 Output for shift 2: 0.673973 Output for shift 3: 0.686936 Output for shift 4: 0.732498 Output for shift 5: 0.713531 Output for shift 6: 0.673834 Output for shift 7: 0.674360 Output for shift 8: 0.682341 Output for shift 9: 0.777981 Output for shift 10: 0.667408 Output for shift 11: 0.726574 You are going to use your student number for this calculation as we have shown in the example above, and at the end of the program you should print Raw Output and Output for shift for each shift as shown in the example. (My student ID18070002012) input [[]] #Enter your student ID to input as 1 x 11 matrix w-[ [0.03370361335647359], [0.07661115022886011], [0.04666099316268933], [0.0038889918178373803], 0.08421628276143776], [0.011537130067313111], [0.10048178370703198], [0.07406232623223129], [0.003752479172986443], [0.038102552367237044], [0.029275344822365088] ] def dot_product(m1, m2): def outfunction (n)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions