def METHOD_NAME(input_tensor, loss_name, target):
    axis = 1 if backend.image_data_format() == "channels_first" else -1
    loss = None
    num_channels = None
    activation = None
    if loss_name == "sparse_categorical_crossentropy":
        loss = lambda y_true, y_pred: backend.sparse_categorical_crossentropy(  # noqa: E501
            y_true, y_pred, axis=axis
        )
        num_channels = int(np.amax(target) + 1)
        activation = "softmax"
    elif loss_name == "categorical_crossentropy":
        loss = lambda y_true, y_pred: backend.categorical_crossentropy(
            y_true, y_pred, axis=axis
        )
        num_channels = target.shape[axis]
        activation = "softmax"
    elif loss_name == "binary_crossentropy":
        loss = lambda y_true, y_pred: backend.binary_crossentropy(
            y_true, y_pred
        )
        num_channels = target.shape[axis]
        activation = "sigmoid"
    predictions = Conv2D(
        num_channels,
        1,
        activation=activation,
        kernel_initializer="ones",
        bias_initializer="ones",
    )(input_tensor)
    simple_model = training.Model(
        inputs=input_tensor, outputs=predictions
    )
    simple_model.compile(optimizer="rmsprop", loss=loss)
    return simple_model