Skip to content

Instantly share code, notes, and snippets.

@bilal2vec
Last active February 27, 2020 20:26
Show Gist options
  • Save bilal2vec/6b00aeff6a3aa9f3ea62b3b26a358fca to your computer and use it in GitHub Desktop.
Save bilal2vec/6b00aeff6a3aa9f3ea62b3b26a358fca to your computer and use it in GitHub Desktop.
# Send a notification to your phone directly with IFTTT (https://ifttt.com/) notifying
# you when a training run ends or at the end of an epoch.
notify({'value1': 'Notification title', 'value2': 'Notification body'}, key=[IFTTT_KEY])
# Automatically set random seeds for Python, numpy, and Pytorch to make sure your results can be reproduced
seed_envirionment(42)
# Print how much GPU memory is currently allocated
gpu_usage(device, digits=4)
# GPU Usage: 6.5 GB
# Print out the number of parameters in a Pytorch model
print(n_params(model))
# 150909673
# Save a model for a particular cross-validation fold to disk
save_model(model, fold=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment