Commit 184625b0 authored by VIGNESHinZONE's avatar VIGNESHinZONE
Browse files

done till test predict

parent 7f636811
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -133,4 +133,4 @@ jobs:
    - name: PyTest
      if: ${{ (success() || failure()) && (steps.install.outcome == 'failure' || steps.install.outcome == 'success') }}
      shell: bash -l {0}
      run: pytest -v -m torch deepchem
      run: pytest -v -m tensorflow deepchem
+11 −1
Original line number Diff line number Diff line
@@ -7,11 +7,18 @@ import os
import pytest

import numpy as np
from deepchem.models import atomic_conv
from deepchem.data import NumpyDataset
from deepchem.feat import AtomicConvFeaturizer

try:
  import tensorflow as tf
  from deepchem.models import atomic_conv
  has_tensorflow = True
except:
  has_tensorflow = False


@pytest.mark.tensorflow
def test_atomic_conv_initialize():
  """Quick test of AtomicConv."""
  acm = atomic_conv.AtomicConvModel(
@@ -29,6 +36,7 @@ def test_atomic_conv_initialize():


@pytest.mark.slow
@pytest.mark.tensorflow
def test_atomic_conv():
  """A simple test that initializes and fits an AtomicConvModel."""
  # For simplicity, let's assume both molecules have same number of
@@ -80,6 +88,7 @@ def test_atomic_conv():


@pytest.mark.slow
@pytest.mark.tensorflow
def test_atomic_conv_variable():
  """A simple test that initializes and fits an AtomicConvModel on variable input size."""
  frag1_num_atoms = 1000
@@ -122,6 +131,7 @@ def test_atomic_conv_variable():


@pytest.mark.slow
@pytest.mark.tensorflow
def test_atomic_conv_with_feat():
  """A simple test for running an atomic convolution on featurized data."""
  dir_path = os.path.dirname(os.path.realpath(__file__))
+8 −1
Original line number Diff line number Diff line
import unittest
import pytest
import tempfile
import deepchem as dc
import numpy as np
import tensorflow as tf
try:
  from StringIO import StringIO
except ImportError:
  from io import StringIO

try:
  import tensorflow as tf
  has_tensorflow = True
except:
  has_tensorflow = False


class TestCallbacks(unittest.TestCase):

  @pytest.mark.tensorflow
  def test_validation(self):
    """Test ValidationCallback."""
    tasks, datasets, transformers = dc.molnet.load_clintox()
+13 −1
Original line number Diff line number Diff line
@@ -5,11 +5,18 @@ import tempfile

import pytest
import deepchem as dc
from deepchem.models import Smiles2Vec, ChemCeption
from deepchem.feat import create_char_to_idx, SmilesToSeq, SmilesToImage
from deepchem.molnet.load_function.chembl25_datasets import CHEMBL25_TASKS

try:
  import tensorflow as tf
  from deepchem.models import Smiles2Vec, ChemCeption
  has_tensorflow = True
except:
  has_tensorflow = False


@pytest.mark.tensorflow
def get_dataset(mode="classification",
                featurizer="smiles2seq",
                max_seq_len=20,
@@ -61,6 +68,7 @@ def get_dataset(mode="classification",


@pytest.mark.slow
@pytest.mark.tensorflow
def test_chemception_regression():
  n_tasks = 5
  dataset, metric = get_dataset(
@@ -73,6 +81,7 @@ def test_chemception_regression():


@pytest.mark.slow
@pytest.mark.tensorflow
def test_chemception_classification():
  n_tasks = 5
  dataset, metric = get_dataset(
@@ -85,6 +94,7 @@ def test_chemception_classification():


@pytest.mark.slow
@pytest.mark.tensorflow
def test_smiles_to_vec_regression():
  n_tasks = 5
  max_seq_len = 20
@@ -106,6 +116,7 @@ def test_smiles_to_vec_regression():


@pytest.mark.slow
@pytest.mark.tensorflow
def test_smiles_to_vec_classification():
  n_tasks = 5
  max_seq_len = 20
@@ -127,6 +138,7 @@ def test_smiles_to_vec_classification():


@pytest.mark.slow
@pytest.mark.tensorflow
def test_chemception_fit_with_augmentation():
  n_tasks = 5
  dataset, metric = get_dataset(
+10 −1
Original line number Diff line number Diff line
import deepchem as dc
import tensorflow as tf
import numpy as np
import pytest
try:
  import tensorflow as tf
  from tensorflow.python.framework import test_util
  has_tensorflow = True
except:
  has_tensorflow = False


class TestCNN(test_util.TensorFlowTestCase):

  @pytest.mark.tensorflow
  def test_1d_cnn_regression(self):
    """Test that a 1D CNN can overfit simple regression datasets."""
    n_samples = 10
@@ -34,6 +40,7 @@ class TestCNN(test_util.TensorFlowTestCase):
    scores = model.evaluate(dataset, [regression_metric])
    assert scores[regression_metric.name] < 0.1

  @pytest.mark.tensorflow
  def test_2d_cnn_classification(self):
    """Test that a 2D CNN can overfit simple classification datasets."""
    n_samples = 10
@@ -62,6 +69,7 @@ class TestCNN(test_util.TensorFlowTestCase):
    scores = model.evaluate(dataset, [classification_metric])
    assert scores[classification_metric.name] > 0.9

  @pytest.mark.tensorflow
  def test_residual_cnn_classification(self):
    """Test that a residual CNN can overfit simple classification datasets."""
    n_samples = 10
@@ -93,6 +101,7 @@ class TestCNN(test_util.TensorFlowTestCase):
    scores = model.evaluate(dataset, [classification_metric])
    assert scores[classification_metric.name] > 0.9

  @pytest.mark.tensorflow
  def test_cnn_regression_uncertainty(self):
    """Test computing uncertainty for a CNN regression model."""
    n_samples = 10
Loading