def ground_truth(n_stimuli, n_dim, n_group):
    'Return a ground truth embedding.'
    stimuli = tf.keras.layers.Embedding((n_stimuli + 1), n_dim, mask_zero=True, embeddings_initializer=tf.keras.initializers.RandomNormal(stddev=0.17))
    shared_similarity = psiz.keras.layers.ExponentialSimilarity(trainable=False, beta_initializer=tf.keras.initializers.Constant(10.0), tau_initializer=tf.keras.initializers.Constant(1.0), gamma_initializer=tf.keras.initializers.Constant(0.0))
    kernel_0 = psiz.keras.layers.DistanceBased(distance=psiz.keras.layers.Minkowski(rho_trainable=False, rho_initializer=tf.keras.initializers.Constant(2.0), w_initializer=tf.keras.initializers.Constant([1.8, 1.8, 0.2, 0.2]), w_constraint=psiz.keras.constraints.NonNegNorm(scale=n_dim, p=1.0)), similarity=shared_similarity)
    kernel_1 = psiz.keras.layers.DistanceBased(distance=psiz.keras.layers.Minkowski(rho_trainable=False, rho_initializer=tf.keras.initializers.Constant(2.0), w_initializer=tf.keras.initializers.Constant([1.0, 1.0, 1.0, 1.0]), w_constraint=psiz.keras.constraints.NonNegNorm(scale=n_dim, p=1.0)), similarity=shared_similarity)
    kernel_2 = psiz.keras.layers.DistanceBased(distance=psiz.keras.layers.Minkowski(rho_trainable=False, rho_initializer=tf.keras.initializers.Constant(2.0), w_initializer=tf.keras.initializers.Constant([0.2, 0.2, 1.8, 1.8]), w_constraint=psiz.keras.constraints.NonNegNorm(scale=n_dim, p=1.0)), similarity=shared_similarity)
    kernel_group = psiz.keras.layers.GateMulti(subnets=[kernel_0, kernel_1, kernel_2], group_col=0)
    model = psiz.keras.models.Rank(stimuli=stimuli, kernel=kernel_group, use_group_kernel=True)
    return model
Return a ground truth embedding.
def ground_truth(n_stimuli, n_dim, n_group):
    
    stimuli = tf.keras.layers.Embedding((n_stimuli + 1), n_dim, mask_zero=True, embeddings_initializer=tf.keras.initializers.RandomNormal(stddev=0.17))
    shared_similarity = psiz.keras.layers.ExponentialSimilarity(trainable=False, beta_initializer=tf.keras.initializers.Constant(10.0), tau_initializer=tf.keras.initializers.Constant(1.0), gamma_initializer=tf.keras.initializers.Constant(0.0))
    kernel_0 = psiz.keras.layers.DistanceBased(distance=psiz.keras.layers.Minkowski(rho_trainable=False, rho_initializer=tf.keras.initializers.Constant(2.0), w_initializer=tf.keras.initializers.Constant([1.8, 1.8, 0.2, 0.2]), w_constraint=psiz.keras.constraints.NonNegNorm(scale=n_dim, p=1.0)), similarity=shared_similarity)
    kernel_1 = psiz.keras.layers.DistanceBased(distance=psiz.keras.layers.Minkowski(rho_trainable=False, rho_initializer=tf.keras.initializers.Constant(2.0), w_initializer=tf.keras.initializers.Constant([1.0, 1.0, 1.0, 1.0]), w_constraint=psiz.keras.constraints.NonNegNorm(scale=n_dim, p=1.0)), similarity=shared_similarity)
    kernel_2 = psiz.keras.layers.DistanceBased(distance=psiz.keras.layers.Minkowski(rho_trainable=False, rho_initializer=tf.keras.initializers.Constant(2.0), w_initializer=tf.keras.initializers.Constant([0.2, 0.2, 1.8, 1.8]), w_constraint=psiz.keras.constraints.NonNegNorm(scale=n_dim, p=1.0)), similarity=shared_similarity)
    kernel_group = psiz.keras.layers.GateMulti(subnets=[kernel_0, kernel_1, kernel_2], group_col=0)
    model = psiz.keras.models.Rank(stimuli=stimuli, kernel=kernel_group, use_group_kernel=True)
    return model