MCPcopy
hub / github.com/horovod/horovod / create_model

Method create_model

test/parallel/test_tensorflow_keras.py:228–241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

226
227 def test_load_model_broadcast(self):
228 def create_model():
229 opt = keras.optimizers.SGD(lr=0.01 * hvd.size(), momentum=0.9)
230 opt = hvd.DistributedOptimizer(opt)
231
232 model = keras.models.Sequential()
233 model.add(keras.layers.Dense(2, input_shape=(3,)))
234 model.add(keras.layers.RepeatVector(3))
235 model.add(keras.layers.TimeDistributed(keras.layers.Dense(3)))
236 model.compile(loss=keras.losses.MSE,
237 optimizer=opt,
238 metrics=[keras.metrics.categorical_accuracy],
239 sample_weight_mode='temporal')
240
241 return model
242
243 with temppath() as fname:
244 with self.session(config=self.config) as sess:

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected