This week, we have released nnabla packages v1.0.13! The main features updated from the previous version are described below:
Spotlight
C++ computation graph building APIs
We have implemented C++ API to design neural networks in a Python-like way.
Our Python-like C++ API handles the function-layer instantiation, composition of layers, and parameter creations.
Users can refer to the sample code in the following directory.
nnabla/examples/cpp/mnist_collection
C++ API’s Usage compared to Python:
- name space
namespace f = nbla::functions;
namespace pf = nbla::parametric_functions;
import nnabla.functions as F
import nnabla.parameteric_functions as PF
- graph design
auto h = pf::convolution(x, 1, 16, {5, 5}, parameters["conv1"]);
h = f::max_pooling(h, {2, 2}, {2, 2}, true, {0, 0});
h = f::relu(h, false);
h = pf::convolution(h, 1, 16, {5, 5}, parameters["conv2"]);
h = f::max_pooling(h, {2, 2}, {2, 2}, true, {0, 0});
h = f::relu(h, false);
h = pf::affine(h, 1, 50, parameters["affine3"]);
h = f::relu(h, false);
h = pf::affine(h, 1, 10, parameters["affine4"]);
h = PF.convolution(x, 16, (5, 5), name='conv1')
h = F.max_pooling(h, (2, 2))
h = F.relu(h, inplace=True)
h = PF.convolution(h, 16, (5, 5), name='conv2')
h = F.max_pooling(h, (2, 2))
h = F.relu(h, inplace=True)
h = PF.affine(h, 50, name='fc3')
h = F.relu(h, inplace=True)
h = PF.affine(h, 10, name='fc4')