codecamp

TensorFlow函数:tf.nn.all_candidate_sampler

tf.nn.all_candidate_sampler函数

tf.nn.all_candidate_sampler(
    true_classes,
    num_true,
    num_sampled,
    unique,
    seed=None,
    name=None
)

定义在:tensorflow/python/ops/candidate_sampling_ops.py.

生成所有类的集合.

确定生成并返回所有可能的类的集合.用于测试目的.没有必要使用它, 因为您还可以使用完全softmax或完整逻辑回归.

参数:

  • true_classes:int64类型的Tensor,并且形状为[batch_size, num_true];目标类.
  • num_true:int,每个训练示例的目标类数.
  • num_sampled:int,可能的类数.
  • unique:bool,忽略.
  • seed:int,特定于操作的种子,默认值为0.
  • name:操作的名称(可选).

返回:

  • sampled_candidates:类型为int64,形状为[num_sampled]的张量.该操作确定地返回整个范围[0, num_sampled].
  • true_expected_count:类型为float的张量,形状与true_classes相同,每个true_classes样本分布下的预期计数,所有返回值均为1.0.
  • sampled_expected_count:类型为float的张量,形状与sampled_candidates相同,每个sampled_candidates样本分布下的预期计数,所有返回值均为1.0.
TensorFlow模块:tf.nn
TensorFlow函数:tf.nn.atrous_conv2d
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

TensorFlow 函数介绍

TensorFlow 函数模块:tf

TensorFlow的image模块

TensorFlow使用之tf.io

TensorFlow使用之tf.keras

TensorFlow函数教程:tf.keras.applications

TensorFlow函数教程:tf.keras.backend

TensorFlow使用之tf.metrics

TensorFlow使用之tf.nn

TensorFlow使用之tf.python_io

TensorFlow 功能函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }