NetModel["name"]

obtains a neural net model with the specified name from the Neural Net Repository.

NetModel[{"name","param1"setting1,}]

obtains a specified model from a parameterized family of models.

NetModel[model,"prop"]

gives property prop of the model.

NetModel[]

gives a dataset of available pre-trained neural net models.

Details

  • A list of available models can be found in the Wolfram Neural Net Repository.
  • NetModel[,"port"->spec] can be used to override the dimensions of an input or output port to the net obtained by NetModel or to attach or modify a NetEncoder or NetDecoder.
  • Possible properties in NetModel[name,prop] include:
  • "ByteCount"size of the evaluation net in bytes
    "ConstructionNotebook"notebook containing explicit network construction
    "EvaluationFunction"complete function to be used for evaluation
    "EvaluationNet"trained net suitable for evaluation
    "InputDomains"domain of inputs to net
    "SourceMetadata"information about the origin of the net
    "TaskType"category of learning task performed by the net
    "TrainingNet"uninitialized architecture used for training
    "TrainingSetData"data resource containing training set used (if available)
    "TrainingSetInformation"information about the training set used to train the net
    "UninitializedEvaluationNet"untrained evaluation net
  • For parameterized models, additional properties include:
  • "DefaultVariant"variant that will be obtained if no parameters are specified
    "ParameterNames"list of parameter names
    "ParametersAllowedValues"association mapping parameter names to their allowed settings
    "ParametersInformation"dataset of information about the parameters
    "Variants"list of variants in the family
  • "SourceMetadata" consists of an association whose keys are based on a subset of properties from the Dublin Core metadata standard, including "Creator", "Date", "Rights", "Source".
  • The effective default value for "EvaluationFunction" is NetModel[,"EvaluationNet"].
  • NetModel may download resources that will be stored in your local object store at $LocalBase, and that can be listed using LocalObjects[] and removed using ResourceRemove.
  • NetModel[][data,opts] specifies that options should be used in applying the net to data. Possible options include:
  • BatchSizeAutomaticfor lists of inputs, the number of inputs to evaluate at once
    NetEvaluationMode"Test"what mode to use in performing evaluation
    TargetDevice"CPU"the target device on which to perform evaluation
    WorkingPrecision"Real32"the numerical precision used for evaluating the net
  • Possible settings for WorkingPrecision include:
  • "Real32"use single-precision real (32-bit)
    "Real64"use double-precision real (64-bit)
    "Mixed"use half-precision real for certain operations
  • WorkingPrecision->"Mixed" is only supported for TargetDevice->"GPU", where it can result in significant performance increases on certain devices.
  • If the output is a NumericArray, then its numeric type is derived from WorkingPrecision.
  • With the setting NetEvaluationMode->"Training", layers such as DropoutLayer will behave as they do for training rather than ordinary evaluation.
  • Information[NetModel[]] gives a report about the network.
  • Information[NetModel[],prop] gives the value of the property prop of NetModel[]. Possible properties are the same as for NetGraph.

Examples

open allclose all

Basic Examples  (2)

Obtain the trained version of a specific neural net:

Apply the trained net to a set of inputs:

Produce class probabilities for a single input:

Obtain a member of a parameterized family:

Scope  (9)

Obtain an uninitialized network:

Modify a parameter of the existing NetEncoder of a model:

Obtain a specific property of a net:

Obtain the default variant of a parameterized family:

Get the settings used for the default variant:

Obtain a specified member of a parameterized family:

Get information about the parameters and their allowed values:

Get explicit settings for all parameters as an association:

Get a list of all possible variants of a family consistent with the specification:

Obtain a list of all available models:

Get a report on a model using the Information wrapper:

Extract a specific property:

Extract a list of properties:

Get a list of all the available Information properties:

Properties & Relations  (2)

The models specified by NetModel are also available via ResourceObject and ResourceData:

Obtain a list of models that have been downloaded:

Remove a specific model that has been downloaded:

Wolfram Research (2017), NetModel, Wolfram Language function, https://reference.wolfram.com/language/ref/NetModel.html (updated 2019).

Text

Wolfram Research (2017), NetModel, Wolfram Language function, https://reference.wolfram.com/language/ref/NetModel.html (updated 2019).

CMS

Wolfram Language. 2017. "NetModel." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/NetModel.html.

APA

Wolfram Language. (2017). NetModel. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NetModel.html

BibTeX

@misc{reference.wolfram_2024_netmodel, author="Wolfram Research", title="{NetModel}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/NetModel.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_netmodel, organization={Wolfram Research}, title={NetModel}, year={2019}, url={https://reference.wolfram.com/language/ref/NetModel.html}, note=[Accessed: 21-November-2024 ]}