code: def encoder_model(backend, current_cases):
      """
      An untrained encoder of given input dimension and backend (this is a "custom" model, NOT an Alibi Detect UAE).
      """
      _, _, data_params = current_cases["data"]
      _, input_dim = data_params["data_shape"]
  
      if backend == "tensorflow":
          model = tf.keras.Sequential(
              [
                  tf.keras.layers.InputLayer(input_shape=(input_dim,)),
                  tf.keras.layers.Dense(5, activation=tf.nn.relu),
                  tf.keras.layers.Dense(LATENT_DIM, activation=None),
              ]
          )
      elif backend in ("pytorch", "keops"):
          model = nn.Sequential(
              nn.Linear(input_dim, 5),
              nn.ReLU(),
              nn.Linear(5, LATENT_DIM),
          )
      else:
          pytest.skip(
              "`encoder_model` only implemented for tensorflow and pytorch."
          )
      return model
  
imports: from functools import partial
  from importlib import import_module
  import numpy
  import tensorflow
  import torch
  import torch.nn
  from sklearn.ensemble import RandomForestClassifier
  from xgboost import XGBClassifier
  from requests.exceptions import HTTPError
  import pytest
  from pytest_cases import fixture, parametrize
  from transformers import AutoTokenizer
  from alibi_detect.cd.pytorch import UAE
  from alibi_detect.cd.pytorch import preprocess_drift
  from alibi_detect.cd.tensorflow import UAE
  from alibi_detect.cd.tensorflow import preprocess_drift
  from alibi_detect.utils.pytorch.kernels import GaussianRBF
  from alibi_detect.utils.pytorch.kernels import DeepKernel
  from alibi_detect.utils.tensorflow.kernels import GaussianRBF
  from alibi_detect.utils.tensorflow.kernels import DeepKernel
  from alibi_detect.models.pytorch import TransformerEmbedding
  from alibi_detect.models.tensorflow import TransformerEmbedding
  from alibi_detect.cd.pytorch import HiddenOutput
  from alibi_detect.cd.tensorflow import HiddenOutput
  from alibi_detect.utils.frameworks import has_keops
label_desc: Use image node_id 1 for calling a global function with example usage: encoder_model(backend, current_cases) and returns: model