ad1908266bd4478886c1d3e667d1fd1cc48f2b69,deepchem/models/tensorgraph/models/sequence_dnn.py,SequenceDNN,__init__,#SequenceDNN#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,42

Before Change


    super(SequenceDNN, self).__init__(loss, **kwargs)
    self.num_tasks = num_tasks
    self.verbose = verbose
    self.add(layers.Conv2D(num_filters, kernel_size=kernel_size))
    self.add(layers.Dropout(dropout))
    self.add(layers.Flatten())
    self.add(layers.Dense(self.num_tasks, activation_fn=tf.nn.relu))

After Change


    if not isinstance(num_filters, collections.Sequence) or not isinstance(
        kernel_size, collections.Sequence):
      raise ValueError("num_filters and kernel_size must be lists")
    if not len(num_filters) == len(kernel_size):
      raise ValueError("num_filters and kernel_size must be of same length")
    n_layers = len(num_filters)
    self.num_tasks = num_tasks
    self.verbose = verbose
    for layer in range(n_layers):
      self.add(
          layers.Conv2D(num_filters[layer], kernel_size=kernel_size[layer]))
      self.add(layers.Dropout(dropout))
    self.add(layers.Flatten())
    self.add(layers.Dense(self.num_tasks, activation_fn=tf.nn.relu))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: deepchem/deepchem
Commit Name: ad1908266bd4478886c1d3e667d1fd1cc48f2b69
Time: 2018-07-15
Author: rbharath@stanford.edu
File Name: deepchem/models/tensorgraph/models/sequence_dnn.py
Class Name: SequenceDNN
Method Name: __init__


Project Name: dmlc/gluon-cv
Commit Name: ea5306a4e8fc9700022f93c3731fb1711e248a8e
Time: 2019-08-09
Author: jerryzh.cn@gmail.com
File Name: gluoncv/model_zoo/resnext.py
Class Name: Block
Method Name: __init__


Project Name: osmr/imgclsmob
Commit Name: 00c06ff2b04c3c991b6fbe1281ff3eede9ca4f94
Time: 2018-10-29
Author: osemery@gmail.com
File Name: gluon/gluoncv2/models/darknet.py
Class Name: DarkNet
Method Name: __init__