Skip to content

Commit

Permalink
Merge branch 'master' into dqc-ci-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatRSingh authored Aug 5, 2024
2 parents 6963adb + 3241eef commit f707a6c
Show file tree
Hide file tree
Showing 8 changed files with 1,947 additions and 56 deletions.
2 changes: 1 addition & 1 deletion deepchem/models/tests/test_graph_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
from deepchem.metrics import Metric, roc_auc_score, mean_absolute_error
from deepchem.molnet import load_bace_classification, load_delaney
from deepchem.utils.data_utils import download_url, get_data_dir
from deepchem.models.torch_models import GraphConvModel

try:
import torch
from deepchem.models.torch_models import GraphConvModel
has_torch = True
except:
has_torch = False
Expand Down
16 changes: 8 additions & 8 deletions deepchem/models/torch_models/tests/test_prot_bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_prot_bert_finetuning(protein_classification_dataset):
model_path = 'Rostlab/prot_bert'

model = ProtBERT(task='classification',
HG_model_path=model_path,
model_path=model_path,
n_tasks=1,
cls_name="LogReg")
loss = model.fit(protein_classification_dataset, nb_epoch=1)
Expand All @@ -43,7 +43,7 @@ def test_prot_bert_finetuning(protein_classification_dataset):
assert prediction.shape == (protein_classification_dataset.y.shape[0], 2)

model = ProtBERT(task='classification',
HG_model_path=model_path,
model_path=model_path,
n_tasks=1,
cls_name="FFN")
loss = model.fit(protein_classification_dataset, nb_epoch=1)
Expand Down Expand Up @@ -74,7 +74,7 @@ def forward(self, x):

custom_torch_CNN_network = SimpleCNN()
model = ProtBERT(task='classification',
HG_model_path=model_path,
model_path=model_path,
n_tasks=1,
cls_name="custom",
classifier_net=custom_torch_CNN_network)
Expand All @@ -93,13 +93,13 @@ def test_protbert_load_from_pretrained(tmpdir):
finetune_model_dir = os.path.join(tmpdir, 'finetune')
model_path = 'Rostlab/prot_bert'
pretrain_model = ProtBERT(task='mlm',
HG_model_path=model_path,
model_path=model_path,
n_tasks=1,
model_dir=pretrain_model_dir)
pretrain_model.save_checkpoint()

finetune_model = ProtBERT(task='classification',
HG_model_path=model_path,
model_path=model_path,
n_tasks=1,
cls_name="LogReg",
model_dir=finetune_model_dir)
Expand All @@ -125,15 +125,15 @@ def test_protbert_load_from_pretrained(tmpdir):
def test_protbert_save_reload(tmpdir):
model_path = 'Rostlab/prot_bert'
model = ProtBERT(task='classification',
HG_model_path=model_path,
model_path=model_path,
n_tasks=1,
cls_name="FFN",
model_dir=tmpdir)
model._ensure_built()
model.save_checkpoint()

model_new = ProtBERT(task='classification',
HG_model_path=model_path,
model_path=model_path,
n_tasks=1,
cls_name="FFN",
model_dir=tmpdir)
Expand Down Expand Up @@ -164,7 +164,7 @@ def test_protbert_overfit():
"../../tests/assets/example_protein_classification.csv"))
model_path = 'Rostlab/prot_bert'
finetune_model = ProtBERT(task='classification',
HG_model_path=model_path,
model_path=model_path,
n_tasks=1,
cls_name="FFN",
batch_size=1,
Expand Down
96 changes: 51 additions & 45 deletions examples/tutorials/Compiling_DeepChem_Torch_Models.ipynb

Large diffs are not rendered by default.

1,162 changes: 1,162 additions & 0 deletions examples/tutorials/Introduction_to_ProtBERT.ipynb

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions examples/tutorials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ tutorials discuss about using DeepChem for specific applications.
* [1 Protein Deep Learning](Protein_Deep_Learning.ipynb)
* [2 Antibody Design via Protein Language Models and Directed Evolution](DeepChem_AntibodyTutorial_Simplified.ipynb)
* [3 Protein Structure Prediction with ESMFold](Protein_Structure_Prediction_with_ESMFold.ipynb)
* [4 Introduction to ProtBERT](Introduction_to_ProtBERT.ipynb)

### Protein Ligand Modeling
* [1 Modeling Protein Ligand Interactions](Modeling_Protein_Ligand_Interactions.ipynb)
* [2 Modeling Protein Ligand Interactions with Atomic Convolutions](Modeling_Protein_Ligand_Interactions_With_Atomic_Convolutions.ipynb)
Expand Down
719 changes: 719 additions & 0 deletions examples/tutorials/crystallization_tendency_regression.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Title,File Name
An Introduction to the Polymers and Their Representation, An_Introduction_to_the_Polymers_and_Their_Representation.ipynb
An Introduction to the Polymers and Their Representation, An_Introduction_to_the_Polymers_and_Their_Representation.ipynb
Utilizing Deepchem Molecular Models for Crystalization Tendency Regression of Polymers, crystallization_tendency_regression.ipynb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Title,File Name
Protein Deep Learning,Protein_Deep_Learning.ipynb
Antibody Design via Protein Language Models and Directed Evolution,DeepChem_AntibodyTutorial_Simplified.ipynb
Protein Structure Prediction with ESMFold, Protein_Structure_Prediction_with_ESMFold.ipynb
Protein Structure Prediction with ESMFold, Protein_Structure_Prediction_with_ESMFold.ipynb
Introduction to ProtBERT, Introduction_to_ProtBERT.ipynb

0 comments on commit f707a6c

Please sign in to comment.