function deepNetworkDesigner(varargin)
% deepNetworkDesigner   Design, visualize, and train deep learning networks
%
% deepNetworkDesigner opens Deep Network Designer. If Deep Network Designer
% is already open, deepNetworkDesigner focuses it.
%
% deepNetworkDesigner(network) opens Deep Network Designer with the
% specified network. The network can be an array of layers or a series
% network, DAG network, or layer graph.
%
% If Deep Network Designer is already open, deepNetworkDesigner(network) 
% displays a prompt to add to or replace the existing network.

%   Copyright 2018-2020 The MathWorks, Inc.

narginchk(0,1);

try
    % Error if current platform is not supported.
    deepapp.internal.common.support.errorIfPlatformNotSupported("Deep Network Designer");
    
    % Configure Deep Network Designer to use JS windows, and use in release
    % mode.
    windowFactory = deepapp.internal.editor.ui.ReleaseWindowFactory();
    appFactory = deepapp.internal.editor.ui.JSAppFactory(windowFactory);
    
    % Start Deep Network Designer
    deepapp.internal.editor.openNetworkEditor(appFactory, varargin{:});    
catch exception
    throw(exception);
end

end