function layer = spatialDropoutLayer(NameValueArgs)

%   Copyright 2023 The MathWorks, Inc.

arguments
    NameValueArgs.Probability         {iAssertValidProbability} = 0.5
    NameValueArgs.Name  {iAssertValidLayerName} = ''
end

% Pass the internal layer to a  function to construct a user visible
% dropout layer.
layer = nnet.cnn.layer.SpatialDropoutLayer(NameValueArgs.Probability , NameValueArgs.Name);
end

function iAssertValidLayerName(name)
nnet.internal.cnn.layer.paramvalidation.validateLayerName(name)
end

function iAssertValidProbability(value)
validateattributes(value, {'numeric'}, ...
    {'scalar','real','finite','>=',0,'<',1});
end
