MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / set_model

Method set_model

tensorflow/python/keras/callbacks.py:1495–1517  ·  view source on GitHub ↗

Sets Keras model and writes graph if specified.

(self, model)

Source from the content-addressed store, hash-verified

1493 'Callback: ' + str(unrecognized_kwargs))
1494
1495 def set_model(self, model):
1496 """Sets Keras model and writes graph if specified."""
1497 self.model = model
1498 with context.eager_mode():
1499 self._close_writers()
1500 if self.write_graph:
1501 with self._get_writer(self._train_run_name).as_default():
1502 with summary_ops_v2.always_record_summaries():
1503 if not model.run_eagerly:
1504 summary_ops_v2.graph(K.get_graph(), step=0)
1505
1506 summary_writable = (
1507 self.model._is_graph_network or # pylint: disable=protected-access
1508 self.model.__class__.__name__ == 'Sequential') # pylint: disable=protected-access
1509 if summary_writable:
1510 summary_ops_v2.keras_model('keras', self.model, step=0)
1511
1512 if self.embeddings_freq:
1513 self._configure_embeddings()
1514
1515 self._prev_summary_writer = context.context().summary_writer
1516 self._prev_summary_recording = context.context().summary_recording
1517 self._prev_summary_step = context.context().summary_step
1518
1519 def _configure_embeddings(self):
1520 """Configure the Projector for embeddings."""

Callers

nothing calls this directly

Calls 7

_close_writersMethod · 0.95
_get_writerMethod · 0.95
_configure_embeddingsMethod · 0.95
keras_modelMethod · 0.80
as_defaultMethod · 0.45
graphMethod · 0.45
contextMethod · 0.45

Tested by

no test coverage detected