Exemplo n.º 1
0
 def before_run(self, run_context):
     del run_context  # Unused by feature importance summary saver hook.
     requests = {
         "global_step": self._global_step_tensor,
         "feature_names": self._feature_names_tensor,
         "feature_usage_counts": self._feature_usage_counts_tensor,
         "feature_gains": self._feature_gains_tensor
     }
     return SessionRunArgs(requests)
Exemplo n.º 2
0
    def before_run(self, run_context):  # pylint: disable=unused-argument
        requests = {"global_step": self._global_step_tensor}
        if self._request_summary:
            if self._summary_op is not None:
                requests["summary"] = self._summary_op
            elif self._scaffold.summary_op is not None:
                requests["summary"] = self._scaffold.summary_op

        return SessionRunArgs(requests)
Exemplo n.º 3
0
    def before_run(self, run_context):  # pylint: disable=unused-argument
        if self._last_saved_time is None:
            # Write graph in the first call.
            training_util.write_graph(
                ops.get_default_graph().as_graph_def(add_shapes=True),
                self._checkpoint_dir, "graph.pbtxt")
            self._summary_writer.add_graph(ops.get_default_graph())

        return SessionRunArgs(self._global_step_tensor)
Exemplo n.º 4
0
 def before_run(self, run_context):  # pylint: disable=unused-argument
     if self._iter_count % self._every_n_iter == 0:
         return SessionRunArgs(self._current_tensors)
     else:
         return None
Exemplo n.º 5
0
 def before_run(self, run_context):  # pylint: disable=unused-argument
     return SessionRunArgs(self._loss_tensor)