Commit ac852b71 authored by Kevin Shen's avatar Kevin Shen
Browse files

merged from master

parent be741b65
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -230,10 +230,10 @@ class PagtnMolGraphFeaturizer(MolecularFeaturizer):

  The featurization is based on `PAGTN model <https://arxiv.org/abs/1905.12712>`_. It is
  slightly more computationally intensive than default Graph Convolution Featuriser, but it
  builds a Molecular Graph connecting all tom pairs accounting for interactions of atom with
  builds a Molecular Graph connecting all atom pairs accounting for interactions of an atom with
  every other atom in the Molecule. According to the paper, interactions between two pairs
  of an atom are dependent on the relative distance between them and calculating the shortest
  path between them.
  of atom are dependent on the relative distance between them and and hence, the function needs
  to calculate the shortest path between them.

  The default node representation is constructed by concatenating the following values,
  and the feature length is 94.
@@ -247,9 +247,9 @@ class PagtnMolGraphFeaturizer(MolecularFeaturizer):
    include ``0 - 5``.
  - Aromaticity: Boolean representing if an atom is aromatic.

  The default edge representation are constructed by concatenating the following values,
  The default edge representation is constructed by concatenating the following values,
  and the feature length is 42. It builds a complete graph where each node is connected to
  every other node. The edge representations are calculated the shortest path between two nodes
  every other node. The edge representations are calculated based on the shortest path between two nodes
  (choose any one if multiple exist). Each bond encountered in the shortest path is used to
  calculate edge features.

+3 −3
Original line number Diff line number Diff line
@@ -86,8 +86,8 @@ class SmilesTokenizer(BertTokenizer):

    super().__init__(vocab_file, **kwargs)
    # take into account special tokens in max length
    self.max_len_single_sentence = self.max_len - 2
    self.max_len_sentences_pair = self.max_len - 3
    self.max_len_single_sentence = self.model_max_length - 2
    self.max_len_sentences_pair = self.model_max_length - 3

    if not os.path.isfile(vocab_file):
      raise ValueError(
@@ -98,7 +98,7 @@ class SmilesTokenizer(BertTokenizer):
    self.ids_to_tokens = collections.OrderedDict(
        [(ids, tok) for tok, ids in self.vocab.items()])
    self.basic_tokenizer = BasicSmilesTokenizer()
    self.init_kwargs["max_len"] = self.max_len
    self.init_kwargs["model_max_length"] = self.model_max_length

  @property
  def vocab_size(self):
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ from deepchem.feat import OneHotFeaturizer
from deepchem.feat.molecule_featurizers.one_hot_featurizer import ZINC_CHARSET


class TestOneHotFeaturizert(unittest.TestCase):
class TestOneHotFeaturizer(unittest.TestCase):
  """
  Test OneHotFeaturizer.
  """
+2 −3
Original line number Diff line number Diff line
@@ -8,9 +8,6 @@ from deepchem.models.multitask import SingletaskToMultitask
from deepchem.models.callbacks import ValidationCallback
from deepchem.models.wandblogger import WandbLogger

from deepchem.models.fcnet import MultitaskRegressor
from deepchem.models.fcnet import MultitaskClassifier
from deepchem.models.fcnet import MultitaskFitTransformRegressor
from deepchem.models.IRV import MultitaskIRVClassifier
from deepchem.models.robust_multitask import RobustMultitaskClassifier
from deepchem.models.robust_multitask import RobustMultitaskRegressor
@@ -38,6 +35,8 @@ try:
  from deepchem.models.torch_models import GAT, GATModel
  from deepchem.models.torch_models import GCN, GCNModel
  from deepchem.models.torch_models import LCNN, LCNNModel
  from deepchem.models.torch_models import Pagtn, PagtnModel
  from deepchem.models.fcnet import MultitaskRegressor, MultitaskClassifier, MultitaskFitTransformRegressor
except ModuleNotFoundError:
  pass

+2 −2
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ try:
except:
  from collections import Sequence as SequenceCollection
from typing import Sequence, Union
from deepchem.utils.typing import KerasActivationFn, LossFn, OneOrMany
from deepchem.utils.typing import ActivationFn, LossFn, OneOrMany
from deepchem.utils.data_utils import load_from_disk, save_to_disk

logger = logging.getLogger(__name__)
@@ -56,7 +56,7 @@ class AtomicConvModel(KerasModel):
      weight_decay_penalty: float = 0.0,
      weight_decay_penalty_type: str = "l2",
      dropouts: OneOrMany[float] = 0.5,
      activation_fns: OneOrMany[KerasActivationFn] = tf.nn.relu,
      activation_fns: OneOrMany[ActivationFn] = tf.nn.relu,
      residual: bool = False,
      learning_rate=0.001,
      **kwargs) -> None:
Loading