当前位置:网站首页>Convn-n dimensional convolution

Convn-n dimensional convolution

2022-06-27 12:34:00 qq-120

convn N Dimensional convolution

One 、 grammar

C = convn(A,B)
C = convn(A,B,shape)

Two 、 explain

C = convn(A,B) Returns an array of A and B Of N Dimensional convolution .
C = convn(A,B,shape) according to shape Returns the sub region of the convolution . for example ,C = convn(A,B,‘same’) Returns the size and in the convolution A The same central part .

3、 ... and 、 Example

Three dimensional convolution

You can control convn The output size of the function . for example ,‘same’ Option deletes the outer part of the convolution , Only return to the central part , The size of this part is the same as the input . Seeking random 2×3×2 Array A And 2×2×2 nucleus B Convolution of . The result is a 3×4×3 Array , Size equal to size(A) + size(B) - 1.

A = rand(2,3,2);
B = 0.25*ones(2,2,2);
C = convn(A,B)
C(:,:,1) =

    0.1307    0.2556    0.1582    0.0333
    0.2102    0.4605    0.3220    0.0718
    0.0795    0.2049    0.1638    0.0384


C(:,:,2) =

    0.3204    0.5873    0.3593    0.0925
    0.4482    0.9268    0.6261    0.1475
    0.1278    0.3395    0.2667    0.0551


C(:,:,3) =

    0.1897    0.3317    0.2011    0.0591
    0.2380    0.4663    0.3040    0.0758
    0.0483    0.1346    0.1029    0.0166

Input parameters

 Insert picture description here
 Insert picture description here

原网站

版权声明
本文为[qq-120]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/178/202206271204258744.html