Main Content


Check equality of neural networks ignoring NaN values

Since R2021a



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

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

    tf = isequaln(net1,...,netN) checks equality of the N neural networks net1, …, netN, ignoring NaN values.


    collapse all

    Create two instances of a pretrained SqueezeNet network.

    net1 = imagePretrainedNetwork;
    net2 = imagePretrainedNetwork;

    Check if the networks are equal ignoring NaN values using the isequaln function.

    tf = isequaln(net1,net2)
    tf = logical

    Input Arguments

    collapse all

    Neural networks, specified as dlnetwork objects.

    Version History

    Introduced in R2021a

    expand all