Skip to content

Instantly share code, notes, and snippets.

@fabclmnt
Created May 6, 2020 14:28
Show Gist options
  • Save fabclmnt/65365950932721a6be65a228bbe2dfac to your computer and use it in GitHub Desktop.
Save fabclmnt/65365950932721a6be65a228bbe2dfac to your computer and use it in GitHub Desktop.
#Initializing the distributed learning algorithm
strategy = tf.distribute.MirroredStrategy()
#Defining some necessary hyperparamters
num_train_examples = info.splits['train'].num_examples
num_test_examples = info.splits['test'].num_examples
BUFFER_SIZE = 10000
BATCH_SIZE_PER_REPLICA = 32
BATCH_SIZE = BATCH_SIZE_PER_REPLICA * strategy.num_replicas_in_sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment