@Namespace(value="tensorflow::ops") @NoOffset @Properties(inherit=tensorflow.class) public class InTopKV2 extends Pointer
K
predictions.
This outputs a batch_size
bool array, an entry out[i]
is true
if the
prediction for the target class is among the top k
predictions among
all predictions for example i
. Note that the behavior of InTopK
differs
from the TopK
op in its handling of ties; if multiple classes have the
same prediction value and straddle the top-k
boundary, all of those
classes are considered to be in the top k
.
More formally, let
\(predictions_i\) be the predictions for all classes for example i
,
\(targets_i\) be the target class for example i
,
\(out_i\) be the output for example i
,
$$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$
Arguments:
* scope: A Scope object
* predictions: A batch_size
x classes
tensor.
* targets: A batch_size
vector of class ids.
* k: Number of top elements to look at for computing precision.
Returns:
* Output
: Computed precision at k
as a bool Tensor
.Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
InTopKV2(Pointer p)
Pointer cast constructor.
|
InTopKV2(Scope scope,
Input predictions,
Input targets,
Input k) |
Modifier and Type | Method and Description |
---|---|
Input |
asInput() |
Output |
asOutput() |
Node |
node() |
Operation |
operation() |
InTopKV2 |
operation(Operation setter) |
Output |
precision() |
InTopKV2 |
precision(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 InTopKV2(Pointer p)
Pointer(Pointer)
.public Node node()
Copyright © 2022. All rights reserved.