Starting from:

$30

ECE 449 — Homework 0

CS 446 / ECE 449 — Homework 0
Version 1
Instructions.
• Homework is due Wednesday, September 1, at noon CST. Homework 0 does not count into your
grade for this course.
• Everyone must submit individually at gradescope under hw0 and hw0code.
• This is a calibration homework; please work alone and don’t hunt for solutions. If Homework 0 is
difficult for you, extensive efforts are expected to complete this course.
• Code submitted on gradescope has an autograder. You can resubmit multiple times, and the autograder
is re-run each time you submit.
Questions.
1. Answer all questions at gradescope under hw0.
2. Fill out the template squares.py (found on Campuswire-Files) with two functions.
(a) Given an integer k, return (1, 2
2
, . . . , k2
) as a numpy array.
Library routines: it suffices to use numpy.arange and arithmetic operations.
(b) Given an integer k, return (1, 2
2
, . . . , k2
) as a pytorch array.
Library routines: it suffices to use torch.arange and arithmetic operations.
Submit your solution on gradescope under hw0code. Remember that you can submit multiple times!
3. Plot the function f(k) = k
2
, e.g., using matplotlib (do not submit figures and do not submit this
part of code. We just want you to get familiar with plotting).
Note. This coding part may seem silly, but please take it seriously, and use this time to get familiar with
Google colab and pytorch, as well as the autograder, etc.
1

More products