Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
bc4f4352
Unverified
Commit
bc4f4352
authored
Dec 05, 2019
by
Mufei Li
Committed by
GitHub
Dec 05, 2019
Browse files
[Chem Model Zoo] Hot fix for README (#1071)
* Fix outdated example * Hot fix
parent
7784f066
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
examples/pytorch/model_zoo/chem/README.md
examples/pytorch/model_zoo/chem/README.md
+3
-3
No files found.
examples/pytorch/model_zoo/chem/README.md
View file @
bc4f4352
...
...
@@ -63,16 +63,16 @@ as front end and Set2Set for output prediction.
### Example Usage of Pre-trained Models
```
python
from
dgl.data.chem
import
Tox21
from
dgl.data.chem
import
Tox21
,
smiles_to_bigraph
,
CanonicalAtomFeaturizer
from
dgl
import
model_zoo
dataset
=
Tox21
()
dataset
=
Tox21
(
smiles_to_bigraph
,
CanonicalAtomFeaturizer
()
)
model
=
model_zoo
.
chem
.
load_pretrained
(
'GCN_Tox21'
)
# Pretrained model loaded
model
.
eval
()
smiles
,
g
,
label
,
mask
=
dataset
[
0
]
feats
=
g
.
ndata
.
pop
(
'h'
)
label_pred
=
model
(
feats
,
g
)
label_pred
=
model
(
g
,
feats
)
print
(
smiles
)
# CCOc1ccc2nc(S(N)(=O)=O)sc2c1
print
(
label_pred
[:,
mask
!=
0
])
# Mask non-existing labels
# tensor([[-0.7956, 0.4054, 0.4288, -0.5565, -0.0911,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment