/TensorFlow 2.3

# tf.compat.v1.losses.Reduction

Types of loss reduction.

Contains the following values:

• `NONE`: Un-reduced weighted losses with the same shape as input.
• `SUM`: Scalar sum of weighted losses.
• `MEAN`: Scalar `SUM` divided by sum of weights. DEPRECATED.
• `SUM_OVER_BATCH_SIZE`: Scalar `SUM` divided by number of elements in losses.
• `SUM_OVER_NONZERO_WEIGHTS`: Scalar `SUM` divided by number of non-zero weights. DEPRECATED.
• `SUM_BY_NONZERO_WEIGHTS`: Same as `SUM_OVER_NONZERO_WEIGHTS`. DEPRECATED.

View source

View source

## Class Variables

• `MEAN = 'weighted_mean'`
• `NONE = 'none'`
• `SUM = 'weighted_sum'`
• `SUM_BY_NONZERO_WEIGHTS = 'weighted_sum_by_nonzero_weights'`
• `SUM_OVER_BATCH_SIZE = 'weighted_sum_over_batch_size'`
• `SUM_OVER_NONZERO_WEIGHTS = 'weighted_sum_by_nonzero_weights'`
{"ft_lang_label":"__label__en","ft_lang_prob":0.6606135,"math_prob":0.9220306,"size":986,"snap":"2021-21-2021-25","text_gpt3_token_len":249,"char_repetition_ratio":0.14358452,"word_repetition_ratio":0.06603774,"special_character_ratio":0.22413793,"punctuation_ratio":0.18620689,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9997774,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-05-14T20:49:39Z\",\"WARC-Record-ID\":\"<urn:uuid:a1863eac-61a9-4912-a8c0-5e5c1408f5cb>\",\"Content-Length\":\"8341\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:ff29490c-ca7c-464c-81ed-024b3ce7b624>\",\"WARC-Concurrent-To\":\"<urn:uuid:e7b14879-306b-489b-a4e3-f100c3415bec>\",\"WARC-IP-Address\":\"104.21.60.80\",\"WARC-Target-URI\":\"https://docs.w3cub.com/tensorflow~2.3/compat/v1/losses/reduction\",\"WARC-Payload-Digest\":\"sha1:GNEK3BMANY5KLWYSYL6LKK7UDPTFLOVZ\",\"WARC-Block-Digest\":\"sha1:W52RTP5H5HUXKXAGDXMV376LHWHWNKDF\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-21/CC-MAIN-2021-21_segments_1620243991207.44_warc_CC-MAIN-20210514183414-20210514213414-00480.warc.gz\"}"}