Home
Course Guidelines
About the course Prerequite Material References
Python
Jupyter Notebooks Python overview
Exercises
Before the semester start: Installation and exercise setup Week 1: Introduction to Python and libraries Week 2: Vector representations Week 3: Linear Algebra Week 4: Linear Transformations Week 5: Models and least squares Week 6: Assignment 1 - Gaze Estimation Week 7: Model selection and descriptive statistics Week 8: Filtering Week 9: Classification Week 10: Evaluation Week 11: Dimensionality reduction Week 12: Clustering and refresh on gradients Week 13: Neural Networks Week 14: Convolutional Neural Networks (CNN's)
Tutorials
Week 1: Data analysis, manipulation and plotting Week 2: Linear algebra Week 3: Transformations tutorial Week 4: Projection and Least Squares tutorial Week 7: Cross-validation and descriptive statistics tutorial Week 8: Filtering tutorial Week 11: Gradient Descent / Ascent
In-class Exercises
In-class 1 In-class 2 In-class 10 In-class 3 In-class 4 In-class 8
Explorer

Document

  • Overview
  • 1. Clustering
  • 2. Gradients: Pen & Paper

Content

  • Task 1 Differentiate the following univariate functions
  • Task 2 Find the partial derivatives of the multivariate functions
  • Task 3 The Chain Rule
  • Task 4 Gradient

Pen and Paper

Task 1: Differentiate the following univariate functions
  1. For $f\left( x \right) = {\left( {6{x^2} + 7x} \right)^4}$ show that $\frac{\partial f}{\partial x} = {{4\left( {12x + 7} \right){{\left( {6{x^2} + 7x} \right)}^3}}}$
  2. For $g\left( t \right) = {\left( {4{t^2} - 3t + 2} \right)^{ - 2}}$ show that $\frac{\partial g}{\partial t} = {{ - 2\left( {8t - 3} \right){{\left( {4{t^2} - 3t + 2} \right)}^{ - 3}}}}$
  3. For $g_2\left( x \right) = 2\sin \left( {3x + \tan \left( x \right)} \right)$ show that $ \frac{\partial g_2}{\partial x} = 2\left( {3 + {{\sec }^2}\left( x \right)} \right)\cos \left( {3x + \tan \left( x \right)} \right)$
  4. For $g_3\left( x \right) = {{\bf{e}}^{1 - \cos \left( x \right)}}$ show that $\frac{\partial g_3}{\partial x} = \sin (x) \bf{e}^{1 - \cos (x)}$
Task 2: Find the partial derivatives of the multivariate functions
  1. For $f\left( {x,y,z} \right) = 4{x^3}{y^2} - {{\bf{e}}^z}{y^4} + \frac{{{z^3}}}{{{x^2}}} + 4y - {x^{16}}$ show that $\frac{\partial f}{\partial x} = 12x^2 y^2 - \frac{2z^3}{x^3} - 16x^{15}$
  2. For $w(x,y,z) = \cos \left( {{x^2} + 2y} \right) - {{\bf{e}}^{4x - {z^{\,4}}y}} + {y^3}$ show that $\frac{{\partial w}}{{\partial y}} = -2 \sin(x^2 + 2y) + z^4 e^{4x - z^4 y} + 3y^2$
  3. For $ r\left( {x,y} \right) = \frac{{{x^2}}}{{{y^2} + 1}} - \frac{{{y^2}}}{{{x^2} + y}}$ show that $\frac{{\partial r}}{{\partial x}} = \frac{2x}{y^2 + 1} + \frac{2x y^2}{(x^2 + y)^2}$
Task 3: The Chain Rule
  1. For $$ z = \cos \left( {( 1 - {t^6})\,{({t^4} - 2t)^2}} \right) $$

    use the Chain Rule to show the partial derivative $$ \frac{\partial z}{\partial t} = {{ - 2\left( {{t^4} - 2t} \right)\left( {1 - {t^6}} \right)\left( {4{t^3} - 2} \right)\sin \left( {\left( {1 - {t^6}} \right){{\left( {{t^4} - 2t} \right)}^2}} \right) + 6{t^5}{{\left( {{t^4} - 2t} \right)}^2}\sin \left( {\left( {1 - {t^6}} \right){{\left( {{t^4} - 2t} \right)}^2}} \right)}} $$

Task 4: Gradient

Given the functions:

  • $f_1\left( {x,y} \right) = \frac{x^2}{cos(3x)} - \frac{{{x^2}}}{{{y^3}}}$
  • $f_2\left( {x,y,z} \right) = (x\cos \left( {xy} \right) + {z^2}{y^4} - 7xz)^2$
  1. Draw the computational graph (following the chain rule) of the functions.
  2. Determine the gradients, $\nabla f_1$ and $\nabla f_2$.