Hi everyone! I just joined the course, it’s great! I’m excited to learn about transformers as soon as possible.
In the assignment 1, if I return theta
as a numpy matrix, then I get this failure:
print(f"The resulting vector of weights is {[round(t, 8) for t in np.squeeze(tmp_theta)]}")
TypeError: type matrix doesn't define __round__ method
So instead, I do theta = theta.tolist()
and the issue goes away. However, when I encounter the test, I get
w1_unittest.test_gradientDescent(gradientDescent)
--> 204 assert result_theta.shape == test_case["input"]["input_dict"]["theta"].shape
205 successful_cases += 1
AttributeError: 'list' object has no attribute 'shape'
So I’m confused. Should we keep theta as a list or as a numpy matrix?
Thank you!
Kovkev