pub struct ClassificationOutput<B: Backend> {
pub loss: Tensor<B, 1>,
pub output: Tensor<B, 2>,
pub targets: Tensor<B, 1, Int>,
}Expand description
Simple classification output adapted for multiple metrics.
Supported metrics:
- Accuracy
- AUROC
- TopKAccuracy
- Perplexity
- Precision (via ConfusionStatsInput)
- Recall (via ConfusionStatsInput)
- FBetaScore (via ConfusionStatsInput)
- Loss.
Fields§
§loss: Tensor<B, 1>The loss.
output: Tensor<B, 2>The class logits or probabilities. Shape: [batch_size, num_classes].
targets: Tensor<B, 1, Int>The ground truth class index for each sample. Shape: [batch_size].
Implementations§
Trait Implementations§
Source§impl<B: Backend> Adaptor<AccuracyInput<B>> for ClassificationOutput<B>
impl<B: Backend> Adaptor<AccuracyInput<B>> for ClassificationOutput<B>
Source§fn adapt(&self) -> AccuracyInput<B>
fn adapt(&self) -> AccuracyInput<B>
Adapt the type to be passed to a metric.
Source§impl<B: Backend> Adaptor<AurocInput<B>> for ClassificationOutput<B>
impl<B: Backend> Adaptor<AurocInput<B>> for ClassificationOutput<B>
Source§fn adapt(&self) -> AurocInput<B>
fn adapt(&self) -> AurocInput<B>
Adapt the type to be passed to a metric.
Source§impl<B: Backend> Adaptor<ConfusionStatsInput<B>> for ClassificationOutput<B>
impl<B: Backend> Adaptor<ConfusionStatsInput<B>> for ClassificationOutput<B>
Source§fn adapt(&self) -> ConfusionStatsInput<B>
fn adapt(&self) -> ConfusionStatsInput<B>
Adapt the type to be passed to a metric.
Source§impl<B: Backend> Adaptor<PerplexityInput<B>> for ClassificationOutput<B>
impl<B: Backend> Adaptor<PerplexityInput<B>> for ClassificationOutput<B>
Source§fn adapt(&self) -> PerplexityInput<B>
fn adapt(&self) -> PerplexityInput<B>
Adapt the type to be passed to a metric.
Source§impl<B: Backend> Adaptor<TopKAccuracyInput<B>> for ClassificationOutput<B>
impl<B: Backend> Adaptor<TopKAccuracyInput<B>> for ClassificationOutput<B>
Source§fn adapt(&self) -> TopKAccuracyInput<B>
fn adapt(&self) -> TopKAccuracyInput<B>
Adapt the type to be passed to a metric.
Auto Trait Implementations§
impl<B> Freeze for ClassificationOutput<B>where
<B as BackendTypes>::IntTensorPrimitive: Freeze,
<B as BackendTypes>::FloatTensorPrimitive: Freeze,
<B as BackendTypes>::QuantizedTensorPrimitive: Freeze,
impl<B> RefUnwindSafe for ClassificationOutput<B>where
<B as BackendTypes>::IntTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::FloatTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: RefUnwindSafe,
impl<B> Send for ClassificationOutput<B>
impl<B> Sync for ClassificationOutput<B>
impl<B> Unpin for ClassificationOutput<B>where
<B as BackendTypes>::IntTensorPrimitive: Unpin,
<B as BackendTypes>::FloatTensorPrimitive: Unpin,
<B as BackendTypes>::QuantizedTensorPrimitive: Unpin,
impl<B> UnsafeUnpin for ClassificationOutput<B>where
<B as BackendTypes>::IntTensorPrimitive: UnsafeUnpin,
<B as BackendTypes>::FloatTensorPrimitive: UnsafeUnpin,
<B as BackendTypes>::QuantizedTensorPrimitive: UnsafeUnpin,
impl<B> UnwindSafe for ClassificationOutput<B>where
<B as BackendTypes>::IntTensorPrimitive: UnwindSafe,
<B as BackendTypes>::FloatTensorPrimitive: UnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more