当前位置:网站首页>One-hot in TF

One-hot in TF

2022-08-11 07:51:00 phac123

  • tf.one_hot (data to be converted, depth=a few categories)
import tensorflow as tfclasses = 3labels = tf.constant([1, 0, 2])output = tf.one_hot(labels, classes)print(output)

insert image description here

Note: When the variable in the list has decimals, one-hot reports an error

原网站

版权声明
本文为[phac123]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/223/202208110645027201.html