Skip to content

Instantly share code, notes, and snippets.

@oscar-defelice
Last active June 3, 2020 08:42
Show Gist options
  • Save oscar-defelice/7b92c8226ccf6a39b642c820b4eb8b56 to your computer and use it in GitHub Desktop.
Save oscar-defelice/7b92c8226ccf6a39b642c820b4eb8b56 to your computer and use it in GitHub Desktop.
print("Starting training process!")
print("-------------------------------------")
t_start = time.time()
for i in range(1, n_iter+1):
triplets = get_triplets_hard(batch_size, X_usr, X_item, df_matrix)
loss = network_train.train_on_batch(triplets, None)
n_iteration += 1
if i % evaluate_every == 0:
print("\n ------------- \n")
print("[{3}] Time for {0} iterations: {1:.1f} mins, Train Loss: {2}".format(i, (time.time()-t_start)/60.0,loss,n_iteration))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment