code: def get_model_agr(
      model_name,
      dataset_name,
      hidden_aggreg=None,
      aggregation_agr_inputs="dist",
      hidden=None,
      **unused_kwargs,
  ):
      """Create agreement model."""
      hidden = parse_layers_string(hidden) if hidden is not None else ()
      hidden_aggreg = (
          parse_layers_string(hidden_aggreg)
          if hidden_aggreg is not None
          else ()
      )
      if model_name == "mlp":
          return MLP(
              output_dim=1,
              hidden_sizes=hidden,
              activation=tf.nn.leaky_relu,
              aggregation=aggregation_agr_inputs,
              hidden_aggregation=hidden_aggreg,
              is_binary_classification=True,
              name="mlp_agr",
          )
      elif model_name == "cnn":
          if dataset_name in ("mnist", "fashion_mnist"):
              channels = 1
          elif dataset_name in (
              "cifar10",
              "cifar100",
              "svhn_cropped",
              "svhn",
          ):
              channels = 3
          else:
              raise ValueError(
                  "Dataset name `%s` unsupported." % dataset_name
              )
          return ImageCNNAgreement(
              output_dim=1,
              channels=channels,
              activation=tf.nn.leaky_relu,
              aggregation=aggregation_agr_inputs,
              hidden_aggregation=hidden_aggreg,
              is_binary_classification=True,
              name="cnn_agr",
          )
      elif model_name == "wide_resnet":
          return WideResnet(
              num_classes=1,
              lrelu_leakiness=0.1,
              horizontal_flip=dataset_name in ("cifar10",),
              random_translation=False,
              gaussian_noise=dataset_name
              not in ("svhn", "svhn_cropped"),
              width=2,
              num_residual_units=4,
              name="wide_resnet_cls",
              is_binary_classification=True,
              aggregation=aggregation_agr_inputs,
              activation=tf.nn.leaky_relu,
              hidden_aggregation=hidden_aggreg,
          )
      else:
          raise NotImplementedError()
  
file_path: neural-structured-learning/research/gam/gam/experiments/helper.py
imports: from ..models.cnn import ImageCNNAgreement
  from ..models.gcn import GCN
  from ..models.mlp import MLP
  from ..models.wide_resnet import WideResnet
  import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: get_model_agr(model_name, dataset_name, hidden_aggreg, aggregation_agr_inputs, hidden) and returns: MLP, ImageCNNAgreement, WideResnet