Skip to content

Instantly share code, notes, and snippets.

@CleanPegasus
Created October 17, 2020 14:51
Show Gist options
  • Save CleanPegasus/ab769bd29d48eec3633319a1e2c272bf to your computer and use it in GitHub Desktop.
Save CleanPegasus/ab769bd29d48eec3633319a1e2c272bf to your computer and use it in GitHub Desktop.
from tensordash.torchdash import Torchdash
histories = Torchdash(
ModelName = '<YOUR_MODEL_NAME>',
email = '<YOUR_EMAIL_ID>',
password = '<YOUR PASSWORD>')
try:
for epoch in range(epochs):
losses = []
for data in trainset:
X, y = data
net.zero_grad()
output = net(X.view(data_shape))
loss = F.nll_loss(output, y)
loss.backward()
optimizer.step()
losses = np.asarray(losses)
histories.sendLoss(loss = np.mean(losses), epoch = epoch, total_epochs = epochs) // Add this line to your training loop
except:
histories.sendCrash()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment