FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge pull request #447 from corochann/chainer-chemistry · opensourceai/docker-python@de61e1f · GitHub

Commit de61e1f

Browse files
authored
Merge pull request Kaggle#447 from corochann/chainer-chemistry
Add chainer-chemistry
2 parents fd3c1cc + 6a0c59f commit de61e1f

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎Dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ RUN pip install flashtext && \
489489
pip install pykalman && \
490490
pip install optuna && \
491491
pip install chainercv && \
492+
pip install chainer-chemistry && \
492493
pip install plotly_express && \
493494
pip install albumentations && \
494495
pip install rtree && \

‎tests/test_chainer_chemistry.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import numpy
2+
import unittest
3+
4+
from chainer import cuda
5+
6+
from chainer_chemistry.models.mlp import MLP
7+
8+
9+
class TestChainerChemistry(unittest.TestCase):
10+
11+
def test_mlp(self):
12+
batch_size = 2
13+
input_dim = 16
14+
out_dim = 4
15+
16+
model = MLP(out_dim=out_dim)
17+
data = numpy.random.rand(batch_size, input_dim).astype(numpy.float32)
18+
y_actual = cuda.to_cpu(model(data).data)
19+
assert y_actual.shape == (batch_size, out_dim)

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL