introtodeeplearning icon indicating copy to clipboard operation
introtodeeplearning copied to clipboard

Update Part1_TensorFlow.ipynb

Open marius190 opened this issue 5 years ago • 3 comments

row_vector = matrix[1] column_vector = matrix[:,2] scalar = matrix[1, 2]

You cant acces third dimension (2) in a 2x2 matrix

marius190 avatar Apr 06 '20 20:04 marius190

matrix is actually defined by yourself in previous cell, just code it bigger than 2

alaneuler avatar Jun 17 '21 12:06 alaneuler

marius190 is right, the following has to replace the current code: row_vector = matrix[0] column_vector = matrix[:,1] scalar = matrix[0, 1]

nightcap1979 avatar Aug 03 '21 11:08 nightcap1979

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.

datasith avatar May 16 '22 14:05 datasith