Why there is different size of output coming from Sequence Folding Layer?

조회 수: 1 (최근 30일)
I wanted to design my own custom layer and I come across this problem.
XTrain.JPG Net.JPG
Above are my Training data and the part of network with custom Layer which does nothing.
Below is the option I have set.
Options.JPG
Though most of the outputs are as expected, there are some output as the below one as well from the flatten Layer.
error.JPG
Please let me know why this is caused?
Below I have also provided the script of Nothing Layer in the network
classdef nothingLayer < nnet.layer.Layer
% Example custom PReLU layer.
properties
Alpha
end
methods
function layer = nothingLayer(name)
% layer = preluLayer(numChannels, name) creates a PReLU layer
% with numChannels channels and specifies the layer name.
% Set layer name.
layer.Name = name;
% Set layer description.
layer.Description = "Split with " + " channels";
% Initialize scaling coefficient.
layer.Alpha = 1;
end
function Z = predict(layer, X)
try
validateattributes( X, { 'numeric' }, { 'vector', 'numel', 322, 'size',[1,322]});
catch e
display(e)
end
Z = layer.Alpha*X;
display(Z);
end
function dLdX = backward(layer, X, ~, dLdZ, ~)
%dLdX = zeros(size(X),'like',dLdZ);
dLdX = layer.Alpha*dLdZ;
end
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Custom Layers에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by