Created
October 17, 2020 14:53
-
-
Save CleanPegasus/324fb7d349e91f0db699239d8a9f41dd 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
from tensordash.tensordash import Customdash | |
histories = Customdash( | |
ModelName = '<YOUR_MODEL_NAME>', | |
email = '<YOUR_EMAIL_ID>', | |
password = '<YOUR PASSWORD>') | |
try: | |
for epoch in range(num_epochs): | |
epoch_loss_avg = tf.keras.metrics.Mean() | |
epoch_accuracy = tf.keras.metrics.SparseCategoricalAccuracy() | |
for x, y in train_dataset: | |
loss_value, grads = grad(model, x, y) | |
optimizer.apply_gradients(zip(grads, model.trainable_variables)) | |
epoch_loss_avg(loss_value) | |
epoch_accuracy(y, model(x, training=True)) | |
train_loss_results.append(epoch_loss_avg.result()) | |
train_accuracy_results.append(epoch_accuracy.result()) | |
histories.sendLoss(loss = epoch_loss_avg.result(), accuracy = epoch_accuracy.result(), 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