1
$\begingroup$

Are the computational complexity of 1D CNN and 2D CNN the same? If not what are their computational complexity and what is the best way to compute them? Considering both forward and backward propagation.

$\endgroup$

2 Answers 2

0
$\begingroup$

For a fixed input size for both networks, the asymptotic complexities are identical, and, ceteris paribus, you would have to expect only a constant factor of difference in actual computation time.

You probably don't want to know the asymptotic complexity for increasing input sizes, right? Anyway, for this case, the 2D CNN would be quadratic in the complexity of the 1D CNN.

$\endgroup$
1
  • $\begingroup$ If you are satisfied with the answer, please accept it. If not, you could consider leaving a comment detailing what you are missing. $\endgroup$
    – frank
    Mar 19, 2022 at 6:28
0
$\begingroup$

CNNs are quite diverse with lots of different settings, i.e., such as kernel size, strides etc, see Torch cnn1d. Considering these settings, it is conceivable to produce a setting of 1D CNN that has the same complexity (FLOPs) of 2D CNNs or equal complexity. Best bet is to really restrict the settings and compute the FLOPs using a practical library, such as flops-counter with pytorch.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.