introtodeeplearning
introtodeeplearning copied to clipboard
Update Part1_TensorFlow.ipynb
row_vector = matrix[1] column_vector = matrix[:,2] scalar = matrix[1, 2]
You cant acces third dimension (2) in a 2x2 matrix
matrix is actually defined by yourself in previous cell, just code it bigger than 2
marius190 is right, the following has to replace the current code: row_vector = matrix[0] column_vector = matrix[:,1] scalar = matrix[0, 1]
Technically, @alaneuler is right. The description uses the term "dimensions" which in this context is interchangeable with "axes" or "rank" (see TensorFlow's documentation). Whether this was intentional or not, a solution could be to define a 2xn matrix with n>=3. I do agree that it would be more appropriate to choose indexes like those @nightcap1979 proposed such that it works for all tensors with 2 axes.