コード例 #1
0
  def test_summarize_activation(self):
    with self.cached_session():
      var = variables.Variable(1)
      op = array_ops.identity(var, name='SummaryTest')
      summary_op = summaries_lib.summarize_activation(op)

      self.assertEquals(summary_op.op.type, 'HistogramSummary')
      names = [op.op.name for op in ops.get_collection(ops.GraphKeys.SUMMARIES)]
      self.assertEquals(len(names), 1)
      self.assertIn(u'SummaryTest/activation', names)
コード例 #2
0
  def test_summarize_activation_relu(self):
    with self.test_session():
      var = variables.Variable(1)
      op = nn_ops.relu(var, name='SummaryTest')
      summary_op = summaries_lib.summarize_activation(op)

      self.assertEquals(summary_op.op.type, 'HistogramSummary')
      names = [op.op.name for op in ops.get_collection(ops.GraphKeys.SUMMARIES)]
      self.assertEquals(len(names), 2)
      self.assertIn(u'SummaryTest/zeros', names)
      self.assertIn(u'SummaryTest/activation', names)
コード例 #3
0
    def test_summarize_activation_relu(self):
        with self.test_session():
            var = variables.Variable(1)
            op = nn_ops.relu(var, name='SummaryTest')
            summary_op = summaries_lib.summarize_activation(op)

            self.assertEquals(summary_op.op.type, 'HistogramSummary')
            names = [
                op.op.name
                for op in ops.get_collection(ops.GraphKeys.SUMMARIES)
            ]
            self.assertEquals(len(names), 2)
            self.assertIn(u'SummaryTest/zeros', names)
            self.assertIn(u'SummaryTest/activation', names)