whether is imageInputLayer flattened?
1 回表示 (過去 30 日間)
古いコメントを表示
I am reading document about imageinputlayer for digits dataset. I find inputsize layer and then can be followed by a fully connected layer. I am confused here. Whether does it mean that inputlayer is flatten automatically how do i know this information since it is not written in document? could you let me know how it works for the inputsize layer?
0 件のコメント
採用された回答
Matt J
2024 年 9 月 11 日
編集済み: Matt J
2024 年 9 月 11 日
No, an imageInputLayer does not reshape the input that it receives, as demonstrated in the following,
net=dlnetwork(imageInputLayer([3,4,2]));
out = net.predict(rand(3,4,2))
A fullyConnectedLayer does keep its Weights in flattened form, as shown below. That may or may not mean that it flattens the input it receives when it comes time to apply the weights. It doesn't really matter, though. The point is, you are not responsible for doing any reshaping/flattening. That is taken care of internally by the layer when its predict() method is called..
net=dlnetwork([imageInputLayer([3,4,2]), fullyConnectedLayer(6)], dlarray(out,"SSC"));
size(net.Layers(2).Weights)
net.predict(rand(3,4,2))
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Image Data Workflows についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!