29c11f550c6b8d9e379afce9b9a2315552884b6c,deepchem/models/tf_new_models/vina_model.py,VinaModel,construct_graph,#VinaModel#Any#Any#Any#Any#Any#Any#,443

Before Change


        // Shape (M,)
        nbrs = tf.squeeze(tf.gather(nbr_list, [atom]))
        // Shape (M, 3)
        nbr_coords = tf.gather(coords, nbrs)
        // Shape (M,)
        nbr_Z = tf.gather(Z, nbrs)

        // Shape (M, 3)
        tiled_atom_coords = tf.tile(tf.reshape(atom_coords, (1, 3)), (M, 1))
        // Shape (M,)
        dists = tf.reduce_sum((tiled_atom_coords - nbr_coords)**2, axis=1)

        atom_interactions = h(dists)
        all_interactions.append(atom_interactions)
      all_interactions = tf.pack(all_interactions)
      energy = tf.reduce_sum(all_interactions)
      loss = tf.mul(0.5 * tf.square(energy - label_placeholder), weights)
      //////////////////////////////////////////////////////////////////////////////////////////// DEBUG

After Change


      // Shape (N_protein+N_ligand, M)
      nbrs = tf.squeeze(tf.gather(nbr_list, all_atoms))
      // Shape (N_protein+N_ligand, M, 3)
      nbr_coords = tf.gather(coords, nbrs)

      // Shape (N_protein+N_ligand, M)
      nbr_Z = tf.gather(Z, nbrs)
      // Shape (N_protein+N_ligand, M, 3)
      tiled_atom_coords = tf.tile(
          tf.reshape(atom_coords, (N_protein+N_ligand, 1, 3)), (1, M, 1))

      // Shape (N_protein+N_ligand, M)
      dists = tf.reduce_sum((tiled_atom_coords - nbr_coords)**2, axis=2)
    
      // TODO(rbharath): Need to subtract out Van-der-Waals radii from dists

      // Shape (N_protein+N_ligand, M)
      atom_interactions = h(dists)
      // Shape (N_protein+N_ligand, M)
      cutoff_interactions = cutoff(dists, atom_interactions)
  
      // TODO(rbharath): Use RDKit to compute number of rotatable bonds in ligand.
      Nrot = 1
  
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: deepchem/deepchem
Commit Name: 29c11f550c6b8d9e379afce9b9a2315552884b6c
Time: 2017-03-22
Author: bharath.ramsundar@gmail.com
File Name: deepchem/models/tf_new_models/vina_model.py
Class Name: VinaModel
Method Name: construct_graph


Project Name: tensorflow/magenta
Commit Name: 5c6408cec7451d5571ecd38eedb108d6c771678b
Time: 2016-11-02
Author: iansimon@users.noreply.github.com
File Name: magenta/models/melody_rnn/melody_rnn_model.py
Class Name: MelodyRnnModel
Method Name: _generate_branches


Project Name: GPflow/GPflow
Commit Name: b3dab0288ddcd165e2ba6f95061b5f3d7bf82a1a
Time: 2016-08-10
Author: james.hensman@gmail.com
File Name: GPflow/vgp.py
Class Name: VGP
Method Name: build_predict