Computer Science  >  EXAMs  >  New York University CS-UY MISC Dibner 03/09/2019 (All)

New York University CS-UY MISC Dibner 03/09/2019

Document Content and Description Below

Introduction to Machine Learning Unit 7 Problem Solutions: Gradient Calculations and Nonlinear Optimization Prof. Sundeep Rangan 1. Simple gradient calculation. Consider a function, J = z1e z1z2 ... , z1 = a1w1w2, z2 = a2w1 + a3w 2 2 , (a) Compute the partial derivatives, ∂J/∂wj for j = 1, 2. (b) Write a python function that, given w and a computes J(w) and ∇J(w). Solution (a) We first compute the partial derivatives, ∂J ∂z1 = e z1z2 + z1z2e z1z2 , ∂J ∂z2 = z 2 1 e z1z2 . and ∂z1 ∂w1 = a1w2, ∂z1 ∂w2 = a1w1, ∂z2 ∂w1 = a2, ∂z2 ∂w2 = 2a3w2 Then, we can use chain rule, ∂J ∂w1 = ∂J ∂z1 ∂z1 ∂w1 + ∂J ∂z2 ∂z2 ∂w1 , ∂J ∂w2 = ∂J ∂z1 ∂z1 ∂w2 + ∂J ∂z2 ∂z2 ∂w2 . You do not to simplify this any further. (b) Taking the equations above, we can write the function as follows. Note that indexing starts at 0. def Jeval(w, a): # Compute z as a function of w z = np.zeros (2) z[0] = a[0]∗w[0]∗w[1], z[1] = a[1]∗w[0] + a[2]∗(w[1]∗∗2) [Show More]

Last updated: 3 years ago

Preview 1 out of 12 pages

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)
Preview image of New York University CS-UY MISC Dibner 03/09/2019 document

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Reviews( 0 )

$4.50

Buy Now

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Instant download

Can't find what you want? Try our AI powered Search

47
0

Document information


Connected school, study & course


About the document


Uploaded On

Nov 04, 2022

Number of pages

12

Written in

All

Seller


Profile illustration for AGRADES
AGRADES

Member since 4 years

8 Documents Sold

Reviews Received
2
0
0
0
0
Additional information

This document has been written for:

Uploaded

Nov 04, 2022

Downloads

 0

Views

 47

Document Keyword Tags

Recommended For You

Get more on EXAMs »

$4.50
What is Scholarfriends

Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·