Warning
This page is located in archive.

HW 1 - Autograd

In this assignment, it would be your task to implement your own autograd library, similar to the one shown in the lab. The difference is that while in the lab we showed autograd for scalar values, your solution shall work with vectors and tensors as well.

The assignment is divided into two parts. In the first one, you will complete the provided autograd library. In the second one, you will use this library to solve a simple dkt problem.

All necessary files are provided here .

Task 1 (6 pts)

The first task is the completion of the engine.py file. Here you will find ellipses (…), where you should complete the functions to correctly compute forward and backward passes.

You will be using the numpy library, its documentation may be found here . Do NOT use any libraries with autograd such as PyTorch or Tensorflow.

Most of the functions should be elementary. However, if you are not sure how to proceed with more complex ones, try consulting the lab materials, before reaching out to tutors.

Please be aware that the variable other in function __pow__ is either int or float and therefore cannot be put in the parent set of output. Backpropagation is available only for objects of class Tensor.

Another tip is that the reshape_gradient function is only needed in __add__ and __mul__ functions. Only in these two functions we have the possibility of broadcasting. The reshape_gradient functions aims to solve the problem of calculating gradient for broadcasted values.

Task 2 (4 pts)

The second task is the completion of computational parts of dkt (direct kinematic task). The robot will later utilize the autograd library you completed to tweak the angles of joints and lengths of arms to reach the desired location.

All necessary information is provided in the hw1.ipynb file. The computational parts of dkt that are to be implemented are in the assignments.py file.

Submission and Evaluation

The whole directory with all files that were provided in the assignment file must be zipped and uploaded to BRUTE. The deadline for the submission is 22.10.2023 00:00:00.

The maximum amount of points you may get is 10. The first task will be auto-evaluated in BRUTE, while the second will be evaluated manually after the submission deadline.

You will receive minus one point for every 24 hours after the deadline. But no more than 9 points will be deducted for late submission.

Good luck, do not forget to play with the task a bit, and in the case of any questions or concerns please contact vlkjan6@fel.cvut.cz.

courses/b3b33urob/tutorials/hw1.txt · Last modified: 2023/12/11 11:15 by vlkjan6