%% Find and Explore Placeholder Layers
% Specify the Keras network file to import layers from.

modelfile = 'digitsDAGnetwithnoise.h5';

% Import the network architecture. The network includes some layer types that are not supported by Deep Learning Toolbox. The importKerasLayers function replaces each unsupported layer with a placeholder layer and returns a warning message.

lgraph = importKerasLayers(modelfile)

% Display the imported layers of the network. Two placeholder layers replace the Gaussian noise layers in the Keras network.

lgraph.Layers

% Find the placeholder layers using findPlaceholderLayers. The output argument contains the two placeholder layers that importKerasLayers inserted in place of the Gaussian noise layers of the Keras network.

placeholders = findPlaceholderLayers(lgraph)

% Specify a name for each placeholder layer.

gaussian1 = placeholders(1);
gaussian2 = placeholders(2);

% Display the configuration of each placeholder layer.

gaussian1.KerasConfiguration
gaussian2.KerasConfiguration

% Copyright 2020 The MathWorks, Inc.