<commit_before>import tensorflow as tf
import ops

class Discriminator:
  def __init__(self, name, is_training, patch_size=70, use_sigmoid=False):
    self.name = name
    self.is_training = is_training
    self.reuse = False
    self.patch_size = 70
    self.use_sigmoid = use_sigmoid

  def __call__(self, input):
    """
    Args:
      input: batch_size x image_size x image_size x 3
    Returns:
      output: 4D tensor batch_size x out_size x out_size x 1 (default 1x5x5x1)
              filled with 0.9 if real, 0.0 if fake
    """
    with tf.variable_scope(self.name):
      batch_size = input.get_shape().as_list()[0]
      patch = tf.random_crop(input,
          [batch_size, self.patch_size, self.patch_size, 3])   # (?, 70, 70, 70)
      C64 = ops.Ck(patch, 64, reuse=self.reuse,
          is_training=self.is_training,
          use_batchnorm=False, name='C64')                     # (?, 35, 35, 64)
      print(C64.get_shape())
      C128 = ops.Ck(C64, 128, reuse=self.reuse,
          is_training=self.is_training, name='C128')           # (?, 18, 18, 128)
      print(C128.get_shape())
      C256 = ops.Ck(C128, 256, reuse=self.reuse,
          is_training=self.is_training, name='C256')           # (?, 9, 9, 256)
      print(C256.get_shape())
      C512 = ops.Ck(C256, 512,reuse=self.reuse,
          is_training=self.is_training, name='C512')           # (?, 5, 5, 512)
      print(C512.get_shape())

      # apply a convolution to produce a 1 dimensional output (1 channel?)
      # set use_sigmoid = False if use_lsgan == True
      output = ops.last_conv(C512, reuse=self.reuse,
          use_sigmoid=self.use_sigmoid, name='output')         # (?, 5, 5, 1)
      print(output.get_shape())

    self.reuse = True
    self.variables = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, scope=self.name)

    return output<commit_msg>Remove unneeded comments<commit_after>import tensorflow as tf
import ops

class Discriminator:
  def __init__(self, name, is_training, patch_size=70, use_sigmoid=False):
    self.name = name
    self.is_training = is_training
    self.reuse = False
    self.patch_size = 70
    self.use_sigmoid = use_sigmoid

  def __call__(self, input):
    """
    Args:
      input: batch_size x image_size x image_size x 3
    Returns:
      output: 4D tensor batch_size x out_size x out_size x 1 (default 1x5x5x1)
              filled with 0.9 if real, 0.0 if fake
    """
    with tf.variable_scope(self.name):
      batch_size = input.get_shape().as_list()[0]
      patch = tf.random_crop(input,
          [batch_size, self.patch_size, self.patch_size, 3])   # (?, 70, 70, 70)
      C64 = ops.Ck(patch, 64, reuse=self.reuse,
          is_training=self.is_training,
          use_batchnorm=False, name='C64')                     # (?, 35, 35, 64)
      C128 = ops.Ck(C64, 128, reuse=self.reuse,
          is_training=self.is_training, name='C128')           # (?, 18, 18, 128)
      C256 = ops.Ck(C128, 256, reuse=self.reuse,
          is_training=self.is_training, name='C256')           # (?, 9, 9, 256)
      C512 = ops.Ck(C256, 512,reuse=self.reuse,
          is_training=self.is_training, name='C512')           # (?, 5, 5, 512)

      # apply a convolution to produce a 1 dimensional output (1 channel?)
      # set use_sigmoid = False if use_lsgan == True
      output = ops.last_conv(C512, reuse=self.reuse,
          use_sigmoid=self.use_sigmoid, name='output')         # (?, 5, 5, 1)

    self.reuse = True
    self.variables = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, scope=self.name)

    return output
{'fraction_non_alphanumeric': 0.12240896358543417, 'fraction_numerical': 0.05630252100840336, 'mean_word_length': 2.596173212487412, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1305278', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1249, 'n_words': 282}