Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how to provide input channel dimension for nnabla convolution operation?

i was trying to write convolution layer in nnable using nnabla.parametric_functions, how do i provide the input channel dimensions to it ?

I tried to look into nnabla docs at https://nnabla.readthedocs.io/en/latest/python/api/parametric_function.html?highlight=convolution#nnabla.parametric_functions.convolution

Here is the code snippet:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

import numpy as np

import nnabla as nn

import nnabla.functions as F

import nnabla.parametric_functions as PF

input = nn.Variable([1,3,224,224])
projection = PF.convolution(input, 768,(16,16), stride=(16,16), name=’projection_conv’)
print("conv", projection.shape)

>Solution :

In NNabla, For PF.convolution(), you only need to specify the output channel dimension i.e. outmaps not input channel dimension. API will itself infer it from the input variable in the backend.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading