%% Import Keras Network Architecture and Weights from Separate Files
% Specify the network file to import layers from and the file containing weights.

modelfile = 'digitsDAGnet.json';
weights = 'digitsDAGnet.weights.h5';

% Import the network architecture and weights from the files you specified. The .json file does not include an output layer. Specify the output layer, so that importKerasLayers adds an output layer at the end of the networks architecture.

layers = importKerasLayers(modelfile, ...
    'ImportWeights',true, ...
    'WeightFile',weights, ...
    'OutputLayerType','classification')

% Copyright 2018 The MathWorks, Inc.