| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -489,6 +489,7 @@ RUN pip install flashtext && \ | |||
| 489 | 489 | pip install pykalman && \ | |
| 490 | 490 | pip install optuna && \ | |
| 491 | 491 | pip install chainercv && \ | |
| 492 | + pip install chainer-chemistry && \ | ||
| 492 | 493 | pip install plotly_express && \ | |
| 493 | 494 | pip install albumentations && \ | |
| 494 | 495 | pip install rtree && \ | |
| Original file line number | Diff line number | Diff 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) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments