# isequal

Check equality of deep learning layer graphs or networks

Since R2021a

## Syntax

``tf = isequal(net1,net2)``
``tf = isequal(net1,...,netN)``

## 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). The `isequal` function can operate on arrays of networks and layer graphs. In this case, the function performs element-wise comparison.```
````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 ```

collapse all

## Version History

Introduced in R2021a