Commit 9eef9e66 authored by Bharath Ramsundar's avatar Bharath Ramsundar Committed by GitHub
Browse files

Merge pull request #487 from lilleswing/tensorflow-1.0.1

Tensorflow 1.0.1
parents e745b56e eda15246
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ You can install deepchem in a new conda environment using the conda commands in

```bash
bash scripts/install_deepchem_conda.sh deepchem
pip install tensorflow-gpu==0.12.1                      # If you want GPU support
pip install tensorflow-gpu==1.0.1                      # If you want GPU support
git clone https://github.com/deepchem/deepchem.git      # Clone deepchem source code from GitHub
cd deepchem
python setup.py install                                 # Manual install
@@ -95,7 +95,7 @@ via this installation procedure.
    contact your local sysadmin to work out a custom installation. If your
    version of Linux is recent, then the following command will work:
    ```
    pip install tensorflow-gpu==0.12.1
    pip install tensorflow-gpu==1.0.1
    ```

9. `deepchem`: Clone the `deepchem` github repo:
@@ -484,3 +484,7 @@ Approaches](http://pubs.acs.org/doi/abs/10.1021/acs.jcim.6b00290)

## About Us
DeepChem is a package by the [Pande group](https://pande.stanford.edu/) at Stanford. DeepChem was originally created by [Bharath Ramsundar](http://rbharath.github.io/), and has grown through the contributions of a number of undergraduate, graduate, and postdoctoral researchers working with the Pande lab.


## Version
1.0.1
+4 −3
Original line number Diff line number Diff line
@@ -608,8 +608,9 @@ class TensorflowClassifier(TensorflowGraphModel):
      A tensor with shape batch_size containing the weighted cost for each
      example.
    """
    return tf.mul(
        tf.nn.softmax_cross_entropy_with_logits(logits, labels), weights)
    return tf.multiply(
        tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=labels),
        weights)

  def add_label_placeholders(self, graph, name_scopes):
    """Add Placeholders for labels for each task.
@@ -762,7 +763,7 @@ class TensorflowRegressor(TensorflowGraphModel):
      A tensor with shape batch_size containing the weighted cost for each
      example.
    """
    return tf.mul(0.5 * tf.square(output - labels), weights)
    return tf.multiply(0.5 * tf.square(output - labels), weights)

  def add_label_placeholders(self, graph, name_scopes):
    """Add Placeholders for labels for each task.
+4 −3
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ def weight_decay(penalty_type, penalty):
    else:
      raise NotImplementedError('Unsupported penalty_type %s' % penalty_type)
    cost *= penalty
    tf.scalar_summary('Weight Decay Cost', cost)
    tf.summary.scalar('Weight Decay Cost', cost)
  return cost


@@ -124,8 +124,9 @@ class TensorflowLogisticRegression(TensorflowGraphModel):
      return loss

  def cost(self, logits, labels, weights):
    return tf.mul(
        tf.nn.sigmoid_cross_entropy_with_logits(logits, labels), weights)
    return tf.multiply(
        tf.nn.sigmoid_cross_entropy_with_logits(logits=logits, labels=labels),
        weights)

  def add_output_ops(self, graph, output):
    # adding output nodes of sigmoid function
+2 −2
Original line number Diff line number Diff line
@@ -173,11 +173,11 @@ class ProgressiveJointRegressor(TensorflowMultiTaskRegressor):
      prev_layers.append(all_layers[(i - 1, prev_task)])
    # prev_layers is a list with elements of size
    # (batch_size, layer_sizes[i-1])
    prev_layer = tf.concat(1, prev_layers)
    prev_layer = tf.concat(axis=1, values=prev_layers)
    alpha = tf.Variable(tf.truncated_normal([
        1,
    ], stddev=alpha_init_stddev))
    prev_layer = tf.mul(alpha, prev_layer)
    prev_layer = tf.multiply(alpha, prev_layer)
    prev_layer_size = task * layer_sizes[i - 1]
    print("Creating V_layer_%d_task%d of shape %s" %
          (i, task, str([prev_layer_size, layer_sizes[i - 1]])))
+3 −3
Original line number Diff line number Diff line
@@ -226,13 +226,13 @@ class ProgressiveMultitaskRegressor(TensorflowMultiTaskRegressor):
      prev_layers.append(all_layers[(i - 1, prev_task)])
    # prev_layers is a list with elements of size
    # (batch_size, layer_sizes[i-1])
    prev_layer = tf.concat(1, prev_layers)
    prev_layer = tf.concat(axis=1, values=prev_layers)
    alpha = tf.Variable(
        tf.truncated_normal([
            1,
        ], stddev=alpha_init_stddev),
        name="alpha_layer_%d_task%d" % (i, task))
    prev_layer = tf.mul(alpha, prev_layer)
    prev_layer = tf.multiply(alpha, prev_layer)
    prev_layer_size = task * layer_sizes[i - 1]
    print("Creating V_layer_%d_task%d of shape %s" %
          (i, task, str([prev_layer_size, layer_sizes[i - 1]])))
@@ -417,7 +417,7 @@ class ProgressiveMultitaskRegressor(TensorflowMultiTaskRegressor):

      sess = self._get_shared_session(train=True)
      #with self._get_shared_session(train=True) as sess:
      sess.run(tf.initialize_all_variables())
      sess.run(tf.global_variables_initializer())
      # Save an initial checkpoint.
      saver = tf.train.Saver(max_to_keep=max_checkpoints_to_keep)
      saver.save(sess, self._save_path, global_step=0)
Loading