You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quick clarification: In cell where we are plotting prediction from untrained model, we are generating new set of X which is between [-2, 2], whereas original X is between [-1, 1]. Not sure why we are plotting y_pretrained which is prediction of untrained model on original X, with respect to new X. As per me, correct method would be either plot with respect to original X or while creating y_pretrained, we should predict on new X. This suggestions does not change the answer and conclusion per se, but seems right thing to do. Correct code would be
fory_pretrain_idxiny_pretrain:
# New X that ranges from -2 to 2 instead of -1 to 1X_new=torch.unsqueeze(torch.linspace(-2, 2, 100), dim=1)
# plt.plot(X_new.numpy(), y_pretrain_idx.cpu().numpy(), 'r-', lw=1)plt.plot(X.cpu().numpy(), y_pretrain_idx.cpu().numpy(), 'r-', lw=1)
plt.scatter(X.cpu().numpy(), y.cpu().numpy(), label='data')
plt.axis('square')
# plt.axis((-1.1, 1.1, -1.1, 1.1));y_combo=torch.stack(y_pretrain)
plt.plot(X_new.numpy(), y_combo.var(dim=0).cpu().numpy(), 'g', label='variance');
plt.legend()
In cell where we are plotting prediction distribution post plotting, variance multiplier is 10, when it should be 30.
X
which is between[-2, 2]
, whereas originalX
is between[-1, 1]
. Not sure why we are plottingy_pretrained
which is prediction of untrained model on originalX
, with respect to newX
. As per me, correct method would be either plot with respect to originalX
or while creatingy_pretrained
, we should predict on newX
. This suggestions does not change the answer and conclusion per se, but seems right thing to do. Correct code would beIncorrect code:
Correct code:
The text was updated successfully, but these errors were encountered: