We all use production quality software comprising millions of lines of code in our daily lives, be it the Android or IoS operating systems or the Facebook or Twitter social networking programs. However, most of us write tens to at max hundred lines of code, that sometimes fail to run on our own computers. This course is a self driven attempt to make our programming skills a bit less clumsy. Thinking carefully (a) how software should be organized into classes and functions to create better abstractions, (b) what data structures and parallelization can improve space-time efficiencies so that our code runs faster and uses less hardware resources like RAM, (c) how the different source and header files should be compiled and cleaned through Makefiles to remember dependencies, (d) how to use gdb instead of scattering printf-s all over the code to debug issues, (e) how to stop mailing our team-mates code versions and then not finding the code to upload in moodle 5 minutes before deadline by appropriate version control in git etc., are more important goals in this course, than just being functionally correct in the tasks.
Tasks will be released on this webpage with submission links on moodle. Though there is no lecture component in the course, the whole class will meet me and the TAs at some intermediate times. The time and venue will be communicated over email. The meetings (3-4 of them over the semester) will be about an hour long. We will discuss common issues we are finding in your submissions, the upcoming tasks etc. Use Piazza to ask doubts.
Late policy: 50% marks cut with 24 hours delay. Zero after that. Plan your time. Medical reasons (own/family) for justified delay should be accompanied with doctor certificate.
Things to care about
Typically this is called the honour code for any course. Read as much as you want online resources and discuss among friends to understand the concepts. But the implementations, graphs and reports that you submit should be your own. No copy pasting of code from the internet or across groups. The reason is simple. We all will be professional programmers at some point in our lives with a Computer Science major or minor degree. Will we trust a civil engineer to build our bridges, if we know he copied all through his engineering projects? Will we trust a doctor to prescribe medicines, if we know that he passed exams by copying from cheatsheets? Will we trust a chemist to create those medicines if she copied all the chemical equations? The professional ethics that we expect from our politicians, doctors, civil engineers, chemists etc. should be the same as what we expect from ourselves. Cheating is insulting our own creativity and intellect.
TLDR: Any plagiarism will fetch you an F grade in the course. No discussions.
[1] Task1: Create a small audio processing library
Task release date Jan 18, final submission deadline Feb 28 with two intermediate deadlines on Jan 31 and Feb 14.
(a) Subtask1: Warming up to compiling and debugging some C++ functions: Jan 18 - Jan 31
Implement the following functions using 32 bit float as datatype.
fully connected (FC) layer that computes inner product of an input matrix of dimensions AxB and a weight matrix of dimensions BxC, to output a matrix of dimension AxC. To this output, a bias vector of dimension AXC is then added elementwise.
non-linear activations of an input matrix of any size with relu and tanh functions on individual matrix elements.
subsampling of square input matrices of any size with max pooling and average pooling functions
We will test each function with different inputs in text files.
vectors stored as single values in each line of the file
matrices stored in column major order in each line of the file
What to submit: Submission link is on Moodle. This is an individual assignment. Upload a single tar file there with name entrynum.tar.gz. It should contain your source code, Makefile and a readme describing the names of the different functions and how to call them from command line. E.g. command line ./yourcode.out fullyconnected inputmatrix.txt weightmatrix.txt biasmatrix.txt. A wrong command line should print the appropriate help.
(b) Subtask2: Code performance, learning plotting through scripts: Feb 1 - Feb 21
Accelerate matrix multiplication speed for FC in your previous implementation with
linear algebra libraries mkl and openblas. Are these libraries faster than your own C++ matrix multiplication?
pthreads. Check for correct computation of the matrix multiplication results and synchronization issues with multiple threads if any.
Measure mean and standard deviation of latencies of the three implementations (mkl, openblas and your pthread implementation) over different matrix sizes and plot a box plot with error bars using gnuplot. Can your own pthread based implementation match openblas, mkl speeds?
In addition to previously mentioned command line ./yourcode.out fullyconnected inputmatrix.txt weightmatrix.txt biasmatrix.txt, there will be one additional command line option (mkl or oprnblas or pthread), to use the appropriate implementation. Again, we will test with different matrices. The outputs should be same across the different implementations (accurate) and the speed differences should match what you present in your graph.
iWhat to submit: Submission link is on Moodle. This assignment is to be done in pair. Any one of the two team members upload a single tar file there with filename entrynum1_entrynum2.tar.gz. It should contain your source code, Makefile, gnuplot script, plot in eps and png formats and a readme describing the names of the different functions and how to call them from command line.
(c) Subtask3: Hierarchical code design, creating library and API: Feb 22 - Mar 6
Implement a deep neural network (DNN) inference for classifying across 12 audio keywords (silence, unknown, yes, no, up, down, left, right, on, off, stop, go). [1x250] input features for each 1 second audio sample will be provided. Your DNN should comprise of FC1 [250x144] -> RELU -> FC2 [144x144] -> RELU -> FC3 [144X144] -> RELU -> FC4 [144x12] -> softmax. The output will be 12 floats representing probabilities for the 12 keywords, adding upto 1, the highest value giving the most probable keyword. Stitch together the most efficient functions you have written for FC, RELU, softmax so far. You will be given pre-trained weights and bias values and some 1 second audio clips with features extracted, to test your implementation. You will create your own audio processing library with an API we can call from a cpp program. Given feature vector of a 1 second audio clip, the API should return the top 3 keywords with highest softmax probabilities.
What to submit: Submission link is on Moodle. This assignment is to be done in pair. Any one of the two team members upload a single tar file there with filename entrynum1_entrynum2.tar.gz. It should contain your source code, Makefile, and a readme describing the names of the different functions and how to call them from command line.
[2] Task2: A 2 player maze game
Create a maze that matches the IIT Delhi campus as closely as you can. Design a two player game, over that maze. For instance, if you can reach Masala Mix earlier than your opponent, you can occupy a bigger table. If you reach basket-ball court earlier, you will find that empty to play. You can make these kind of things as the final goal. You can also combine a set of tasks, that have to be completed before reaching the final goal. Like collecting the basket ball from the hostel sports room before going to grounds. Some tasks might have a predefined time, like hostel lunch. Missing lunch within that time, can cause a player to drop unconscious after a while, unless he/she eats something from hostel canteen or Amul. Obstacles can include hungry dogs or angry professors, that you might want to avoid on a route. You can increase a player's speed using Yulu between two Yulu stands. Think of a way to give points to the players as the game progresses and a win/loss criteria. Keep the game challenging and uexpected, even after multiple plays. E.g. generate the obstacles at random places on the fly.
The above points are just examples, feel free to build something completely different. The only restriction is it has to be set in IITD campus, and should be at leats 2 players. You and your team-mate should be able to play the game over Wi-Fi. You will have to learn about sockets for this. You can use arrow keys to move your players. Think about usability at all steps of designing and implementing the game. Appropriate rules shown at game start. Smooth controls. Appropriate messages when network is slow. Sound effects.
What to submit:There will be no Moodle submission link for this. You need to commit everything on git by Apr 18 09:00 am. Any commit after that will be ignored. What we will check on git: (a) The source code of the game with cpp, header and Makefile. (b) Readme with installation instructions you used on your machine for different libraries and packages (with your OS details). Also all online resource links that you used to learn and get ideas from. (c) A status.txt file with status of the game at time of submission: if it compiles and runs as you want it, just mention that. But if you got stuck somewhere, like sockets didn't work for you or one of the I/Os (mouse or keyboard) gave issues that you couldn't resolve till the end, include the problem and whatever you tried. We will mark you for your efforts, even if things haven't all worked for you. (d) 10-15 slides in PDF format describing your game rules, game stages (with screenshot images) -- so that people who would like to play has a clear idea what to expect during the play. In demo (in person, with Riju, on Apr 18-19-20), you will need to clone your own repo on your machine, build it using your Makefile and play the game. Appropriate questions will be asked.
Note: Your git repo should be private. Riju will ask you to add her as a collaborator. Don't make a public repo, if you don't want other teams to copy-paste your game implementation.