700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > tf.keras.losses.CategoricalHinge 损失函数示例

tf.keras.losses.CategoricalHinge 损失函数示例

时间:2018-08-27 01:07:02

相关推荐

tf.keras.losses.CategoricalHinge 损失函数示例

import tensorflow as tf

铰链损失函数

它可用于“最大间隔(max-margin)”分类,其最著名的应用是作为SVM的损失函数。

二分类

多分类

y_true = [[0, 1], [0, 0]]y_pred = [[0.6, 0.4], [0.4, 0.6]]# Using 'auto'/'sum_over_batch_size' reduction type.h = tf.keras.losses.CategoricalHinge()h(y_true, y_pred).numpy()

1.4000001

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。