Created
June 1, 2019 05:01
-
-
Save singhrahuldps/3f955a6c37b98670ba8cd3058b23e11f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a model object | |
# y_range has been extended(0-11) than required(1-10) to make the | |
# values lie in the linear region of the sigmoid function | |
model = EmbeddingModel(10, len(users), len(items), [0,11], initialise = 0.01).cuda() | |
# split the data, returns a list [train, valid] | |
data = get_data(ratings, 0.1) | |
# loss = mean((target_rating - predicted_rating)**2) | |
loss_function = nn.MSELoss() | |
# optimizer function will update the weights of the Neural Net | |
optimizer = optim.SGD(model.parameters(), lr=0.05, momentum=0.9) | |
# batch size for each input | |
bs = 128 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment