Skip to content

Instantly share code, notes, and snippets.

@groverpr
Created December 29, 2017 08:15
Show Gist options
  • Select an option

  • Save groverpr/4f7528a52ac20a8db641c8fdc1e71eb5 to your computer and use it in GitHub Desktop.

Select an option

Save groverpr/4f7528a52ac20a8db641c8fdc1e71eb5 to your computer and use it in GitHub Desktop.
fitting model cf
# n_users: count unique users (671), n_movies: count unique movies (9066)
model = EmbeddingNet(n_users, n_movies)
# model.parameters() for back-propagation of weights
# lr = 1e-3, weight decay = 1e-5 and using adam optimizer
opt = optim.Adam(model.parameters(), 1e-3, weight_decay=1e-5)
# fitting model,
fit(model, data, 3, opt, F.mse_loss)
# learning rate annealing (for more, check links at the end)
set_lrs(opt, 1e-3)
fit(model, data, 3, opt, F.mse_loss)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment