so we start with y vector with shape (1,) converted into matrix (depth,)
resulting vector before reshape is of shape (4,) meaning it was of dimension (c,). If it is already a in vertical vector format, why do we need to reshape it?
After reshape, the tensor is the same of the same shape (4,) on initial test and and on new_y_test both shaped shape=(6,).
the shape has not changed. I experimented with switching axis and through trial and error completed the function, but I still do not understand what the purpose of the reshape function was here if no change?
on the picture before the exercise the transformation is clearly from (1, m) to (c, m), but the purpose of the function is not clear to me
before reshape tf.Tensor([0. 1. 0. 0.], shape=(4,), dtype=float32)
after reshape tf.Tensor([0. 1. 0. 0.], shape=(4,), dtype=float32)
Test 1: tf.Tensor([0. 1. 0. 0.], shape=(4,), dtype=float32)
before reshape tf.Tensor(
[[0.]
[0.]
[1.]
[0.]], shape=(4, 1), dtype=float32)
after reshape tf.Tensor([0. 0. 1. 0.], shape=(4,), dtype=float32)
Test 2: tf.Tensor([0. 0. 1. 0.], shape=(4,), dtype=float32)
All test passed
Expected output
Test 1: tf.Tensor([0. 1. 0. 0.], shape=(4,), dtype=float32)
Test 2: tf.Tensor([0. 0. 1. 0.], shape=(4,), dtype=float32)
before reshape Tensor(“one_hot:0”, shape=(6,), dtype=float32)
after reshape Tensor(“Reshape:0”, shape=(6,), dtype=float32)
before reshape Tensor(“one_hot:0”, shape=(6,), dtype=float32)
after reshape Tensor(“Reshape:0”, shape=(6,), dtype=float32)