code: def test_custom_encoder_decoder(moon_dataset):
      """test using a custom encoder / decoder"""
      dims = (2,)
      n_components = 2
      encoder = tf.keras.Sequential(
          [
              tf.keras.layers.InputLayer(input_shape=dims),
              tf.keras.layers.Flatten(),
              tf.keras.layers.Dense(units=100, activation="relu"),
              tf.keras.layers.Dense(units=100, activation="relu"),
              tf.keras.layers.Dense(units=100, activation="relu"),
              tf.keras.layers.Dense(units=n_components, name="z"),
          ]
      )
  
      decoder = tf.keras.Sequential(
          [
              tf.keras.layers.InputLayer(input_shape=n_components),
              tf.keras.layers.Dense(units=100, activation="relu"),
              tf.keras.layers.Dense(units=100, activation="relu"),
              tf.keras.layers.Dense(units=100, activation="relu"),
              tf.keras.layers.Dense(
                  units=np.product(dims), name="recon", activation=None
              ),
              tf.keras.layers.Reshape(dims),
          ]
      )
  
      embedder = ParametricUMAP(
          encoder=encoder,
          decoder=decoder,
          dims=dims,
          parametric_reconstruction=True,
          verbose=True,
      )
      embedding = embedder.fit_transform(moon_dataset)
      # completes successfully
      assert embedding is not None
      assert embedding.shape == (moon_dataset.shape[0], 2)
  
file_path: umap/umap/tests/test_parametric_umap.py
imports: import numpy
  import tempfile
  import pytest
  from sklearn.datasets import make_moons
  from sklearn.model_selection import train_test_split
  from numpy.testing import assert_array_almost_equal
  import platform
label_desc: Use image node_id 6 for calling a global function with example usage: test_custom_encoder_decoder(moon_dataset) without return types