Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -16,24 +16,33 @@ pipeline_tag: feature-extraction
|
|
| 16 |
This model is the foundational scoring backend for the [BioTarget](https://github.com/homerquan/biotarget) end-to-end drug discovery pipeline.
|
| 17 |
|
| 18 |
## 🎯 Model Architecture
|
| 19 |
-
- **Graph Encoder**: [SchNet](https://github.com/atomistic-machine-learning/schnetpack) (3D Message Passing Neural Network). Processes atomic coordinates
|
| 20 |
-
- **Text Encoder**:
|
| 21 |
- **Latent Dimension**: 128
|
| 22 |
- **Objective**: InfoNCE (Contrastive Loss)
|
| 23 |
|
| 24 |
## 💻 Usage
|
| 25 |
|
| 26 |
-
To use this checkpoint, you will need the
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
| 35 |
|
|
|
|
|
|
|
|
|
|
| 36 |
|
|
|
|
|
|
|
| 37 |
|
| 38 |
## 📚 Training Data
|
| 39 |
The model's contrastive space was constructed using:
|
|
|
|
| 16 |
This model is the foundational scoring backend for the [BioTarget](https://github.com/homerquan/biotarget) end-to-end drug discovery pipeline.
|
| 17 |
|
| 18 |
## 🎯 Model Architecture
|
| 19 |
+
- **Graph Encoder**: [SchNet](https://github.com/atomistic-machine-learning/schnetpack) (3D Message Passing Neural Network). Processes atomic coordinates `pos` and atomic numbers `z`.
|
| 20 |
+
- **Text Encoder**: `distilbert-base-uncased`
|
| 21 |
- **Latent Dimension**: 128
|
| 22 |
- **Objective**: InfoNCE (Contrastive Loss)
|
| 23 |
|
| 24 |
## 💻 Usage
|
| 25 |
|
| 26 |
+
To use this checkpoint, you will need the `drugclip` python package.
|
| 27 |
|
| 28 |
+
```python
|
| 29 |
+
import torch
|
| 30 |
+
from drugclip.models.align_model import DrugCLIP
|
| 31 |
|
| 32 |
+
# 1. Initialize the architecture
|
| 33 |
+
model = DrugCLIP(hidden_channels=64, out_dim=128, text_model='distilbert-base-uncased')
|
| 34 |
|
| 35 |
+
# 2. Load the downloaded checkpoint
|
| 36 |
+
state_dict = torch.load('best.ckpt', map_location='cpu')
|
| 37 |
+
model.load_state_dict(state_dict)
|
| 38 |
+
model.eval()
|
| 39 |
|
| 40 |
+
# 3. Embed natural language clinical intent
|
| 41 |
+
text_emb = model.text_encoder(['This molecule failed clinical trials due to severe toxicity and side effects.'])
|
| 42 |
+
text_emb = torch.nn.functional.normalize(text_emb, p=2, dim=1)
|
| 43 |
|
| 44 |
+
# (Molecular processing requires RDKit and PyTorch Geometric Data Batches)
|
| 45 |
+
```
|
| 46 |
|
| 47 |
## 📚 Training Data
|
| 48 |
The model's contrastive space was constructed using:
|