functionToLayerGraph
(To be removed) Convert deep learning model function to a layer graph
functionToLayerGraph will be removed in a future release. Construct layer graphs manually instead. (since R2023a) For a list of layers,
see List of Deep Learning Layers. For information about
developing custom layers, see Define Custom Deep Learning Layers.
Description
returns a layer graph based on the deep learning array function lgraph = functionToLayerGraph(fun,x)fun.
functionToLayerGraph converts only those operations in
fun that operate on dlarray objects among the inputs
in x. To include extra parameters or data in fun, see
the topic Parameterizing Functions or the example Create Layer Graph from Function.
functionToLayerGraph evaluates
fun(x) and traces the execution to derive an
equivalent layer graph, to the extent possible. The steps in
fun(x) that
functionToLayerGraph can trace are both based on
dlarray arguments and are supported calls for
dlarray. See List of Functions with dlarray Support. For unsupported functions,
functionToLayerGraph creates a PlaceholderLayer.
specifies options using one or more name-value pair arguments in addition to the input
arguments in the previous syntax.lgraph = functionToLayerGraph(fun,x,Name,Value)
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Limitations
functionToLayerGraph does not support these deep learning
operations:
If you use functionToLayerGraph with a function that contains these
operations, then the resulting layer graph contains placeholder layers.