Last active
July 5, 2020 11:11
-
-
Save siakon89/28e3f2285d5a0ee69714579933863cee 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 smdebug.trials import create_trial | |
from smdebug import modes | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# Get the tensors from S3 | |
s3_output_path = estimator.latest_job_debugger_artifacts_path() | |
# Create a Trial https://github.com/awslabs/sagemaker-debugger/blob/master/docs/analysis.md#Trial | |
trial = create_trial(s3_output_path) | |
# Get all the tensor names | |
trial.tensor_names() | |
# Get the values of the tensor `val_acc`for mode GLOBAL (validation accuracy) | |
values = trial.tensor("val_acc").values(modes.GLOBAL) | |
# Convert it to numpy array | |
values_eval = np.array(list(values.items())) | |
fig = plt.figure() | |
plt.plot(values_eval[:, 1]) | |
fig.suptitle('Validation Accuracy', fontsize=20) | |
plt.xlabel('Intervals of sampling', fontsize=18) | |
plt.ylabel('Acuracy', fontsize=16) | |
fig.savefig('temp.jpg') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment