Main Content


Check equality of neural networks

Since R2021a



    tf = isequal(net1,net2) checks the equality of dlnetwork objects net1 and net2. The function returns 1 (true) when the properties and architectures match. Otherwise, the function returns 0 (false).

    The isequal function can operate on arrays of networks. In this case, the function performs element-wise comparison.

    tf = isequal(net1,...,netN) checks equality of the N networks net1, …, netN.


    collapse all

    Create two instances of a pretrained SqueezeNet network.

    net1 = imagePretrainedNetwork;
    net2 = imagePretrainedNetwork;

    Check if the networks are equal using the isequal function.

    tf = isequal(net1,net2)
    tf = logical

    Input Arguments

    collapse all

    Neural networks, specified as dlnetwork objects.

    Version History

    Introduced in R2021a

    expand all