Skip to content

Instantly share code, notes, and snippets.

@shashankprasanna
Created April 2, 2020 21:09
Show Gist options
  • Save shashankprasanna/8a9a9c2fa6070a815a529af0e6a127f3 to your computer and use it in GitHub Desktop.
Save shashankprasanna/8a9a9c2fa6070a815a529af0e6a127f3 to your computer and use it in GitHub Desktop.
import smdebug.tensorflow as smd
job_name = 'tf-debug-job'
hook = smd.KerasHook(out_dir=f'./smd_outputs/{job_name}',
tensorboard_dir=f'./tb_logs/{job_name}',
save_config=smd.SaveConfig(save_interval=1),
include_collections=['gradients', 'biases'])
opt = tf.keras.optimizers.SGD(learning_rate=0.01, momentum=0.9, name='SGD')
opt = hook.wrap_optimizer(opt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment