Main Content

isequal

Check equality of deep learning layer graphs or networks

    Description

    example

    tf = isequal(net1,net2) checks the equality of SeriesNetwork, DAGNetwork, LayerGraph, or dlnetwork objects net1 and net2.

    • If both inputs are SeriesNetwork or DAGNetwork objects, or one of each, then the function returns 1 (true) when the properties and architectures match. Otherwise, the function returns 0 (false).

    • If both inputs are LayerGraph objects, then the function returns 1 (true) when the properties and architectures match. Otherwise, the function returns 0 (false).

    • If both inputs are dlnetwork objects, then the function returns 1 (true) when the properties and architectures match. Otherwise, the function returns 0 (false).

    • For other combinations, the function returns 0 (false).

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

    Examples

    collapse all

    Create two instances of SqueezeNet layer graphs.

    lgraph1 = squeezenet('Weights','none');
    lgraph2 = squeezenet('Weights','none');

    Check if the layer graphs are equal using the isequal function.

    tf = isequal(lgraph1,lgraph2)
    tf = logical
       1
    
    

    Create two instances of a pretrained SqueezeNet network.

    net1 = squeezenet;
    net2 = squeezenet;

    Check if the networks are equal using the isequal function.

    tf = isequal(net1,net2)
    tf = logical
       1
    
    

    Input Arguments

    collapse all

    Network or layer graph, specified as a SeriesNetwork, DAGNetwork, dlnetwork , or LayerGraph object.

    Introduced in R2021a