f073f90e639afa1ee2141dbed5d76e26ed31d5de,texar/modules/encoders/conv1d_discriminator.py,CNN,_build,#CNN#,54

Before Change


             / tf.cast(tf.shape(inputs)[1], tf.float32)
    if self._hparams.use_gate:
      proj = tf.tanh(self._gate_proj(inputs))
      scores = tf.nn.softmax(tf.reduce_sum(self._gate_u * proj, [2]) / gamma)
      inputs = tf.expand_dims(scores, 2) * inputs

    inputs = tf.nn.dropout(
      inputs, utils.switch_dropout(self._hparams.input_keep_prob))

    pooled_outputs = []
    for conv_layer in self._conv_layers:
      h = conv_layer(inputs)
      h = tf.nn.leaky_relu(h, alpha=self._hparams.leaky_relu_alpha)
      // pooling after conv
      h = tf.reduce_max(h, axis=1)
      pooled_outputs.append(h)

    outputs = tf.concat(pooled_outputs, 1)

After Change


        gamma = 1.
      scores = tf.reduce_sum(self._gate_u * proj, [2]) / gamma
      scores = scores * mask + ((1.0 - mask) * tf.float32.min)
      scores = tf.nn.softmax(scores)
      inputs = tf.expand_dims(scores, 2) * inputs
    else:
      inputs = tf.expands_dims(mask, 2) * inputs

    inputs = tf.nn.dropout(
      inputs, utils.switch_dropout(self._hparams.input_keep_prob))

    pooled_outputs = []
    for conv_layer in self._conv_layers:
      h = conv_layer(inputs)
      h = tf.nn.leaky_relu(h, alpha=self._hparams.leaky_relu_alpha)
      // pooling after conv
      h = tf.reduce_max(h, axis=1)
      pooled_outputs.append(h)

    outputs = tf.concat(pooled_outputs, 1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 2

Instances


Project Name: asyml/texar
Commit Name: f073f90e639afa1ee2141dbed5d76e26ed31d5de
Time: 2018-01-29
Author: zichaoy@cs.cmu.edu
File Name: texar/modules/encoders/conv1d_discriminator.py
Class Name: CNN
Method Name: _build


Project Name: NifTK/NiftyNet
Commit Name: 2a09f6d21d2720a6deeff46b345ace3a931bb7fa
Time: 2018-08-19
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/crf.py
Class Name:
Method Name: ftheta


Project Name: tensorlayer/tensorlayer
Commit Name: fc6827262a552bfce18c874228e4390af1bc7ea4
Time: 2019-02-22
Author: 37874862+warshallrho@users.noreply.github.com
File Name: examples/pretrained_cnn/tutorial_models_vgg16.py
Class Name:
Method Name:


Project Name: tensorlayer/tensorlayer
Commit Name: 64e0b2eece79af2a8ddac24d2d7e024996dc2426
Time: 2019-02-19
Author: 37874862+warshallrho@users.noreply.github.com
File Name: examples/pretrained_cnn/tutorial_models_vgg16.py
Class Name:
Method Name:


Project Name: NifTK/NiftyNet
Commit Name: 4c9acddb0bfbbd66d8ab26687bb0079630d5f622
Time: 2018-08-18
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/crf.py
Class Name:
Method Name: ftheta