Struct SequenceOutput
pub struct SequenceOutput {
pub loss: Tensor<1>,
pub logits: Tensor<3>,
pub predictions: Option<Tensor<2, Int>>,
pub targets: Tensor<2, Int>,
}Expand description
Sequence prediction output adapted for multiple metrics.
Supported metrics:
- Accuracy
- TopKAccuracy
- Perplexity
- Loss
- CER
- WER
Fields§
§loss: Tensor<1>The loss.
logits: Tensor<3>Raw logits. Shape: [batch_size, seq_len, vocab_size]
predictions: Option<Tensor<2, Int>>Optional predicted token indices. Shape: [batch_size, seq_length].
If not provided, predictions default to argmax of logits along the last dimension.
targets: Tensor<2, Int>The target token indices. Shape: [batch_size, seq_length]
Implementations§
Trait Implementations§
§impl Adaptor<AccuracyInput> for SequenceOutput
impl Adaptor<AccuracyInput> for SequenceOutput
§fn adapt(&self) -> AccuracyInput
fn adapt(&self) -> AccuracyInput
Adapt the type to be passed to a metric.
§impl Adaptor<CerInput> for SequenceOutput
impl Adaptor<CerInput> for SequenceOutput
§impl Adaptor<LossInput> for SequenceOutput
impl Adaptor<LossInput> for SequenceOutput
§impl Adaptor<PerplexityInput> for SequenceOutput
impl Adaptor<PerplexityInput> for SequenceOutput
§fn adapt(&self) -> PerplexityInput
fn adapt(&self) -> PerplexityInput
Adapt the type to be passed to a metric.
§impl Adaptor<TopKAccuracyInput> for SequenceOutput
impl Adaptor<TopKAccuracyInput> for SequenceOutput
§fn adapt(&self) -> TopKAccuracyInput
fn adapt(&self) -> TopKAccuracyInput
Adapt the type to be passed to a metric.
§impl Adaptor<WerInput> for SequenceOutput
impl Adaptor<WerInput> for SequenceOutput
§impl ItemLazy for SequenceOutput
impl ItemLazy for SequenceOutput
§fn sync(self) -> Result<SequenceOutput, ExecutionError>
fn sync(self) -> Result<SequenceOutput, ExecutionError>
Sync the item. Read more
Auto Trait Implementations§
impl Freeze for SequenceOutput
impl RefUnwindSafe for SequenceOutput
impl Send for SequenceOutput
impl Sync for SequenceOutput
impl Unpin for SequenceOutput
impl UnsafeUnpin for SequenceOutput
impl UnwindSafe for SequenceOutput
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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