Skip to content

Instantly share code, notes, and snippets.

@Niranjankumar-c
Created October 20, 2019 06:29
Show Gist options
  • Save Niranjankumar-c/c9415971f1b3ffe40c033ffb9e9220f6 to your computer and use it in GitHub Desktop.
Save Niranjankumar-c/c9415971f1b3ffe40c033ffb9e9220f6 to your computer and use it in GitHub Desktop.
data for visualizing the dropout
N = 50 #number of data points
noise = 0.3
#generate the train data
X_train = torch.unsqueeze(torch.linspace(-1, 1, N),1)
Y_train = X_train + noise * torch.normal(torch.zeros(N,1), torch.ones(N,1))
#generate the test data
X_test = torch.unsqueeze(torch.linspace(-1,1,N),1)
Y_test = X_test + noise * torch.normal(torch.zeros(N,1), torch.ones(N,1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment