5bc94ca6b68471029002bc66b8543fe7f9529654,deepchem/models/graph_models.py,DAGModel,__init__,#DAGModel#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,359

Before Change


    calculation_masks = Input(shape=(self.max_atoms,), dtype=tf.bool)
    membership = Input(shape=tuple(), dtype=tf.int32)
    n_atoms = Input(shape=tuple(), dtype=tf.int32)
    dropout_switch = tf.keras.Input(shape=tuple())
    dag_layer1 = layers.DAGLayer(
        n_graph_feat=self.n_graph_feat,
        n_atom_feat=self.n_atom_feat,
        max_atoms=self.max_atoms,
        layer_sizes=self.layer_sizes,
        dropout=self.dropout,
        batch_size=batch_size)([
            atom_features, parents, calculation_orders, calculation_masks,
            n_atoms, dropout_switch
        ])
    dag_gather = layers.DAGGather(
        n_graph_feat=self.n_graph_feat,
        n_outputs=self.n_outputs,
        max_atoms=self.max_atoms,
        layer_sizes=self.layer_sizes_gather,
        dropout=self.dropout)([dag_layer1, membership, dropout_switch])
    n_tasks = self.n_tasks
    if self.mode == "classification":
      n_classes = self.n_classes
      logits = Reshape((n_tasks,
                        n_classes))(Dense(n_tasks * n_classes)(dag_gather))
      output = Softmax()(logits)
      outputs = [output, logits]
      output_types = ["prediction", "loss"]
      loss = SoftmaxCrossEntropy()
    else:
      fc_layer_size = 50
      inter = Dense(fc_layer_size)(dag_gather)
      if self.dropout is not None and self.dropout > 0.0:
        inter = Dropout(rate=self.dropout)(inter)
      //output = Dense(n_tasks)(dag_gather)
      output = Dense(n_tasks)(inter)
      if self.uncertainty:
        log_var = Dense(n_tasks)(dag_gather)

After Change


        raise ValueError("Dropout must be included to predict uncertainty")

    ////////////////////////////////////////////////////////////////////////////////////////
    print("self.dropout")
    print(self.dropout)
    ////////////////////////////////////////////////////////////////////////////////////////
    // Build the model.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: deepchem/deepchem
Commit Name: 5bc94ca6b68471029002bc66b8543fe7f9529654
Time: 2020-04-04
Author: bharath@Bharaths-MBP.zyxel.com
File Name: deepchem/models/graph_models.py
Class Name: DAGModel
Method Name: __init__


Project Name: CyberZHG/keras-bert
Commit Name: 792d64bd6f64c4483af5ca1cdb7cbe22c13b5715
Time: 2019-07-12
Author: CyberZHG@gmail.com
File Name: demo/load_model/load_and_pool.py
Class Name:
Method Name:


Project Name: CyberZHG/keras-bert
Commit Name: 792d64bd6f64c4483af5ca1cdb7cbe22c13b5715
Time: 2019-07-12
Author: CyberZHG@gmail.com
File Name: demo/load_model/load_and_predict.py
Class Name:
Method Name:


Project Name: CyberZHG/keras-bert
Commit Name: 792d64bd6f64c4483af5ca1cdb7cbe22c13b5715
Time: 2019-07-12
Author: CyberZHG@gmail.com
File Name: demo/load_model/load_and_extract.py
Class Name:
Method Name: