Evaluate all summaries by ``tf.summary.merge_all``, and write them to logs. This callback is one of the :func:`DEFAULT_CALLBACKS()`. Args: period (int): by default the callback summarizes once every epoch. This option (if not set to 0) makes it additionally summari
(period=0, run_alone=False, key=None)
| 118 | |
| 119 | |
| 120 | def MergeAllSummaries(period=0, run_alone=False, key=None): |
| 121 | """ |
| 122 | Evaluate all summaries by ``tf.summary.merge_all``, and write them to logs. |
| 123 | |
| 124 | This callback is one of the :func:`DEFAULT_CALLBACKS()`. |
| 125 | |
| 126 | Args: |
| 127 | period (int): by default the callback summarizes once every epoch. |
| 128 | This option (if not set to 0) makes it additionally summarize every ``period`` steps. |
| 129 | run_alone (bool): whether to evaluate the summaries alone. |
| 130 | If True, summaries will be evaluated after each epoch alone. |
| 131 | If False, summaries will be evaluated together with the |
| 132 | `sess.run` calls, in the last step of each epoch. |
| 133 | For :class:`SimpleTrainer`, it needs to be False because summary may |
| 134 | depend on inputs. |
| 135 | key (str): the collection of summary tensors. Same as in ``tf.summary.merge_all``. |
| 136 | Default is ``tf.GraphKeys.SUMMARIES``. |
| 137 | """ |
| 138 | if key is None: |
| 139 | key = tf.GraphKeys.SUMMARIES |
| 140 | period = int(period) |
| 141 | if run_alone: |
| 142 | return MergeAllSummaries_RunAlone(period, key) |
| 143 | else: |
| 144 | return MergeAllSummaries_RunWithOp(period, key) |
| 145 | |
| 146 | |
| 147 | class SimpleMovingAverage(Callback): |
no test coverage detected