<commit_before>import tensorflow as tf


def custom_loss(y_true, y_pred):
    mse = tf.losses.mean_squared_error(y_true, y_pred)

    return 100 * mse<commit_msg>add huber loss<commit_after>import tensorflow as tf


def custom_loss(y_true, y_pred):
    mse = tf.losses.mean_squared_error(y_true, y_pred)

    return 100 * mse


def huber_loss(y_true, y_pred):
    """
    for reqression tasks
    """
    threshold = 1
    error = y_true - y_pred
    is_small_error = tf.abs(error) <= threshold
    small_error_loss = tf.square(error) / 2
    big_error_loss = threshold * (tf.abs(error) - (0.5 * threshold))
    return tf.where(is_small_error, small_error_loss, big_error_loss)
{'fraction_non_alphanumeric': 0.1019202363367799, 'fraction_numerical': 0.014771048744460856, 'mean_word_length': 3.7746478873239435, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '679933', 'n_tokens_mistral': 265, 'n_tokens_neox': 247, 'n_words': 53}