Introduction to Deep Learning and Generative AI, Quiz 2
You have a tensor x = torch.tensor([1, 2, 3, 4]).
You perform
stacked_x_dim0 = torch.stack([x, x, x], dim=0)And
stacked_x_dim1 = torch.stack([x, x, x], dim=1)What will be the shapes of stacked_x_dim0 and stacked_x_dim1 respectively?
You have a tensor `x = torch.tensor([1, 2, 3, 4])`. You perform stacked_x_dim0 = torch.stack([x, x, x], dim=0) And stacked_x_dim1 = torch.stack([x, x, x], dim=1) What will be the shapes of `stacked_x_dim0` and `stacked_x_dim1` respectively? You have a PyTorch tensor gpu_tensor = torch.tensor([1, 2, 3]).to('cuda') residing on the GPU. You then attempt to convert it directly to a NumPy array using numpy_array = gpu_tensor.numpy() What will be the outcome of this operation? The Huber Loss function is introduced as a robust alternative to Mean Squared Error (MSE) and Mean Absolute Error (MAE). What is the primary characteristic of Huber Loss that makes it robust to outliers?