def build_kernel(similarity, n_dim):
    'Build kernel for single group.'
    mink = psiz.keras.layers.Minkowski(rho_trainable=False, rho_initializer=tf.keras.initializers.Constant(2.0), w_constraint=psiz.keras.constraints.NonNegNorm(scale=n_dim, p=1.0))
    kernel = psiz.keras.layers.DistanceBased(distance=mink, similarity=similarity)
    return kernel
Build kernel for single group.
def build_kernel(similarity, n_dim):
    
    mink = psiz.keras.layers.Minkowski(rho_trainable=False, rho_initializer=tf.keras.initializers.Constant(2.0), w_constraint=psiz.keras.constraints.NonNegNorm(scale=n_dim, p=1.0))
    kernel = psiz.keras.layers.DistanceBased(distance=mink, similarity=similarity)
    return kernel