Created
April 1, 2020 02:37
-
-
Save agastidukare/b42f80245192e8e98a08a69781c7543c 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
# This function calculates, loss, predictions and gradients | |
def covnet(t,params): | |
test_acc,target_class, predicted_class = accuracy(params, shape_as_image(test_images, test_labels)) | |
test_loss = loss(params, shape_as_image(test_images, test_labels),test=t) | |
grads = grad(lo)(shape_as_image(test_images, test_labels),params) | |
if(t==1): | |
print('Test set loss, accuracy (%): ({:.2f}, {:.2f})'.format(test_loss, 100 * test_acc)) | |
print('predicted_class,target_class', predicted_class,target_class) | |
return grads, test_acc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment