@Namespace(value="tensorflow::ops") @NoOffset @Properties(inherit=tensorflow.class) public class AllCandidateSampler extends Pointer
Generates labels for candidate sampling with a learned unigram distribution.
See explanations of candidate sampling and the data formats at
go/candidate-sampling.
For each batch, this op picks a single set of sampled candidate labels.
The advantages of sampling candidates per-batch are simplicity and the
possibility of efficient dense matrix multiplication. The disadvantage is that
the sampled candidates must be chosen independently of the context and of the
true labels.
Arguments:
* scope: A Scope object
* true_classes: A batch_size * num_true matrix, in which each row contains the
IDs of the num_true target_classes in the corresponding original label.
* num_true: Number of true labels per context.
* num_sampled: Number of candidates to produce.
* unique: If unique is true, we sample with rejection, so that all sampled
candidates in a batch are unique. This requires some approximation to
estimate the post-rejection sampling probabilities.
Optional attributes (see Attrs
):
* seed: If either seed or seed2 are set to be non-zero, the random number
generator is seeded by the given seed. Otherwise, it is seeded by a
random seed.
* seed2: An second seed to avoid seed collision.
Returns:
* Output
sampled_candidates: A vector of length num_sampled, in which each element is
the ID of a sampled candidate.
* Output
true_expected_count: A batch_size * num_true matrix, representing
the number of times each candidate is expected to occur in a batch
of sampled candidates. If unique=true, then this is a probability.
* Output
sampled_expected_count: A vector of length num_sampled, for each sampled
candidate representing the number of times the candidate is expected
to occur in a batch of sampled candidates. If unique=true, then this is a
probability.
Modifier and Type | Class and Description |
---|---|
static class |
AllCandidateSampler.Attrs
Optional attribute setters for AllCandidateSampler
|
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
AllCandidateSampler(Pointer p)
Pointer cast constructor.
|
AllCandidateSampler(Scope scope,
Input true_classes,
long num_true,
long num_sampled,
boolean unique) |
AllCandidateSampler(Scope scope,
Input true_classes,
long num_true,
long num_sampled,
boolean unique,
AllCandidateSampler.Attrs attrs) |
Modifier and Type | Method and Description |
---|---|
Operation |
operation() |
AllCandidateSampler |
operation(Operation setter) |
Output |
sampled_candidates() |
AllCandidateSampler |
sampled_candidates(Output setter) |
Output |
sampled_expected_count() |
AllCandidateSampler |
sampled_expected_count(Output setter) |
static AllCandidateSampler.Attrs |
Seed(long x) |
static AllCandidateSampler.Attrs |
Seed2(long x) |
Output |
true_expected_count() |
AllCandidateSampler |
true_expected_count(Output setter) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public AllCandidateSampler(Pointer p)
Pointer(Pointer)
.public AllCandidateSampler(@Const @ByRef Scope scope, @ByVal Input true_classes, @Cast(value="tensorflow::int64") long num_true, @Cast(value="tensorflow::int64") long num_sampled, @Cast(value="bool") boolean unique)
@ByVal public static AllCandidateSampler.Attrs Seed(@Cast(value="tensorflow::int64") long x)
@ByVal public static AllCandidateSampler.Attrs Seed2(@Cast(value="tensorflow::int64") long x)
public AllCandidateSampler operation(Operation setter)
public AllCandidateSampler sampled_candidates(Output setter)
public AllCandidateSampler true_expected_count(Output setter)
public AllCandidateSampler sampled_expected_count(Output setter)
Copyright © 2022. All rights reserved.