9010d90576d8da39f8c3be180cbccd0d1663f7c2,hypergan/discriminators/pyramid_nostride_discriminator.py,,discriminator,#Any#Any#Any#Any#Any#Any#Any#,29

Before Change


    for i in range(depth):
      //TODO better name for `batch_norm`?
      if batch_norm is not None:
          net = batch_norm(batch_size*2, name=prefix+"_expand_bn_"+str(i))(net)
      net = activation(net)
    
      //TODO: cross-d, overwritable
      // APPEND xs[i] and gs[i]
      if(i < len(xs) and i > 0):
        x_filter_i = tf.concat(3, [xs[i], config["layer_filter"](None, xs[i])])
        g_filter_i = tf.concat(3, [gs[i], config["layer_filter"](None, xs[i])])
        xg = tf.concat(0, [x_filter_i, g_filter_i])
        xg += tf.random_normal(xg.get_shape(), mean=0, stddev=config["noise_stddev"]*i, dtype=root_config["dtype"])

        xgs.append(xg)
  
        net = tf.concat(3, [net, xg])
    
      filter_size_w = 2
      filter_size_h = 2
      filter = [1,filter_size_w,filter_size_h,1]
      stride = [1,filter_size_w,filter_size_h,1]
      net = conv2d(net, int(int(net.get_shape()[3])*depth_increase), name=prefix+"_expand_layer"+str(i), k_w=3, k_h=3, d_h=1, d_w=1)
      net = tf.nn.avg_pool(net, ksize=filter, strides=stride, padding="SAME")

      print("[discriminator] layer", net)

    k=-1
    if batch_norm is not None:
        net = batch_norm(batch_size*2, name=prefix+"_expand_bn_end_"+str(i))(net)
    net = activation(net)
    net = tf.reshape(net, [batch_size*2, -1])

    //TODO: cross-d feature
    regularizers = []
    for regularizer in config["regularizers"]:
        regs = regularizer(root_config, net, prefix)
        regularizers += regs

 
    return tf.concat(1, [net]+regularizers)

After Change


      //TODO: cross-d, overwritable
      // APPEND xs[i] and gs[i]
      if(i < len(xs) and i > 0):
        if config["layer_filter"]:
            x_filter_i = tf.concat(3, [xs[i], config["layer_filter"](None, xs[i])])
            g_filter_i = tf.concat(3, [gs[i], config["layer_filter"](None, xs[i])])
            xg = tf.concat(0, [x_filter_i, g_filter_i])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: HyperGAN/HyperGAN
Commit Name: 9010d90576d8da39f8c3be180cbccd0d1663f7c2
Time: 2017-01-29
Author: martyn@255bits.com
File Name: hypergan/discriminators/pyramid_nostride_discriminator.py
Class Name:
Method Name: discriminator


Project Name: HyperGAN/HyperGAN
Commit Name: 2f49f5d198bf4ff0216227617c2929bff04228e9
Time: 2017-06-13
Author: martyn@255bits.com
File Name: hypergan/generators/resize_conv_generator.py
Class Name: ResizeConvGenerator
Method Name: build


Project Name: Scitator/catalyst
Commit Name: def07745ebcbe08ebb2fbba124bd07873edc8c9c
Time: 2018-09-29
Author: scitator@gmail.com
File Name: models/unet.py
Class Name: ConvRelu
Method Name: forward