Skip to content

Instantly share code, notes, and snippets.

View fromradio's full-sized avatar

Ruimin Wang fromradio

View GitHub Profile
@vpj
vpj / keras_distributed.py
Last active August 1, 2023 19:41
Distributed learning for keras models with tensorflow
'''
The code is inspired from François Chollet's answer to the following quora question[1] and distributed tensorflow tutorial[2].
It runs the Keras MNIST mlp example across multiple servers.
This sample code runs multiple processes on a single host. It can be configured
to run on multiple hosts simply by chaning the host names given in *ClusterSpec*.
Training the model: