@Namespace(value="tensorflow::ops") @NoOffset public static class tensorflow.FixedUnigramCandidateSampler extends Pointer
Attrs):
* vocab_file: Each valid line in this file (which should have a CSV-like format)
corresponds to a valid word ID. IDs are in sequential order, starting from
num_reserved_ids. The last entry in each line is expected to be a value
corresponding to the count or relative probability. Exactly one of vocab_file
and unigrams needs to be passed to this op.
* distortion: The distortion is used to skew the unigram probability distribution.
Each weight is first raised to the distortion's power before adding to the
internal unigram distribution. As a result, distortion = 1.0 gives regular
unigram sampling (as defined by the vocab file), and distortion = 0.0 gives
a uniform distribution.
* num_reserved_ids: Optionally some reserved IDs can be added in the range [0,
..., num_reserved_ids) by the users. One use case is that a special unknown
word token is used as ID 0. These IDs will have a sampling probability of 0.
* num_shards: A sampler can be used to sample from a subset of the original range
in order to speed up the whole computation through parallelism. This parameter
(together with 'shard') indicates the number of partitions that are being
used in the overall computation.
* shard: A sampler can be used to sample from a subset of the original range
in order to speed up the whole computation through parallelism. This parameter
(together with 'num_shards') indicates the particular partition number of a
sampler op, when partitioning is being used.
* unigrams: A list of unigram counts or probabilities, one per ID in sequential
order. Exactly one of vocab_file and unigrams should be passed to this op.
* 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 |
tensorflow.FixedUnigramCandidateSampler.Attrs
Optional attribute setters for FixedUnigramCandidateSampler
|
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator| Constructor and Description |
|---|
FixedUnigramCandidateSampler(Pointer p)
Pointer cast constructor.
|
FixedUnigramCandidateSampler(tensorflow.Scope scope,
tensorflow.Input true_classes,
long num_true,
long num_sampled,
boolean unique,
long range_max) |
FixedUnigramCandidateSampler(tensorflow.Scope scope,
tensorflow.Input true_classes,
long num_true,
long num_sampled,
boolean unique,
long range_max,
tensorflow.FixedUnigramCandidateSampler.Attrs attrs) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, position, put, realloc, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zeropublic FixedUnigramCandidateSampler(Pointer p)
Pointer.Pointer(Pointer).public FixedUnigramCandidateSampler(@Const @ByRef tensorflow.Scope scope, @ByVal tensorflow.Input true_classes, @Cast(value="tensorflow::int64") long num_true, @Cast(value="tensorflow::int64") long num_sampled, @Cast(value="bool") boolean unique, @Cast(value="tensorflow::int64") long range_max)
public FixedUnigramCandidateSampler(@Const @ByRef tensorflow.Scope scope, @ByVal tensorflow.Input true_classes, @Cast(value="tensorflow::int64") long num_true, @Cast(value="tensorflow::int64") long num_sampled, @Cast(value="bool") boolean unique, @Cast(value="tensorflow::int64") long range_max, @Const @ByRef tensorflow.FixedUnigramCandidateSampler.Attrs attrs)
@ByVal public static tensorflow.FixedUnigramCandidateSampler.Attrs VocabFile(@tensorflow.StringPiece BytePointer x)
@ByVal public static tensorflow.FixedUnigramCandidateSampler.Attrs VocabFile(@tensorflow.StringPiece String x)
@ByVal public static tensorflow.FixedUnigramCandidateSampler.Attrs Distortion(float x)
@ByVal public static tensorflow.FixedUnigramCandidateSampler.Attrs NumReservedIds(@Cast(value="tensorflow::int64") long x)
@ByVal public static tensorflow.FixedUnigramCandidateSampler.Attrs NumShards(@Cast(value="tensorflow::int64") long x)
@ByVal public static tensorflow.FixedUnigramCandidateSampler.Attrs Shard(@Cast(value="tensorflow::int64") long x)
@ByVal public static tensorflow.FixedUnigramCandidateSampler.Attrs Unigrams(@tensorflow.ArraySlice FloatPointer x)
@ByVal public static tensorflow.FixedUnigramCandidateSampler.Attrs Unigrams(@tensorflow.ArraySlice FloatBuffer x)
@ByVal public static tensorflow.FixedUnigramCandidateSampler.Attrs Unigrams(@tensorflow.ArraySlice float... x)
@ByVal public static tensorflow.FixedUnigramCandidateSampler.Attrs Seed(@Cast(value="tensorflow::int64") long x)
@ByVal public static tensorflow.FixedUnigramCandidateSampler.Attrs Seed2(@Cast(value="tensorflow::int64") long x)
@ByRef public tensorflow.Operation operation()
public tensorflow.FixedUnigramCandidateSampler operation(tensorflow.Operation operation)
@ByRef public tensorflow.Output sampled_candidates()
public tensorflow.FixedUnigramCandidateSampler sampled_candidates(tensorflow.Output sampled_candidates)
@ByRef public tensorflow.Output true_expected_count()
public tensorflow.FixedUnigramCandidateSampler true_expected_count(tensorflow.Output true_expected_count)
@ByRef public tensorflow.Output sampled_expected_count()
public tensorflow.FixedUnigramCandidateSampler sampled_expected_count(tensorflow.Output sampled_expected_count)
Copyright © 2019. All rights reserved.