pub struct DirichletCalibrator {
pub num_classes: usize,
pub weights: Vec<f64>,
pub bias: Vec<f64>,
}Expand description
ディリクレ較正器 (Dirichlet Calibrator)。
Kull et al. (NeurIPS 2019) の Dirichlet 較正に基づく。 対数確率ベクトル $\ln \mathbf{p}$ に対するアフィン変換 $\mathbf{z} = W \ln \mathbf{p} + \mathbf{b}$ を行い、 Softmax を適用して適正較正された確率分布を出力する。
Fields§
§num_classes: usizeクラス数 $K$。
weights: Vec<f64>重み行列 $W \in \mathbb{R}^{K \times K}$ (行優先フラット配列)。
bias: Vec<f64>バイアスベクトル $\mathbf{b} \in \mathbb{R}^K$。
Implementations§
Source§impl DirichletCalibrator
impl DirichletCalibrator
Sourcepub fn identity(num_classes: usize) -> Self
pub fn identity(num_classes: usize) -> Self
恒等変換を行う較正器 (未較正時) を生成する。
$W = I, \mathbf{b} = \mathbf{0}$ となり、入力確率分布がそのまま維持される。
Trait Implementations§
Source§impl Clone for DirichletCalibrator
impl Clone for DirichletCalibrator
Source§fn clone(&self) -> DirichletCalibrator
fn clone(&self) -> DirichletCalibrator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DirichletCalibrator
impl Debug for DirichletCalibrator
Source§impl<'de> Deserialize<'de> for DirichletCalibrator
impl<'de> Deserialize<'de> for DirichletCalibrator
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DirichletCalibrator
impl PartialEq for DirichletCalibrator
Source§impl Serialize for DirichletCalibrator
impl Serialize for DirichletCalibrator
impl StructuralPartialEq for DirichletCalibrator
Auto Trait Implementations§
impl Freeze for DirichletCalibrator
impl RefUnwindSafe for DirichletCalibrator
impl Send for DirichletCalibrator
impl Sync for DirichletCalibrator
impl Unpin for DirichletCalibrator
impl UnsafeUnpin for DirichletCalibrator
impl UnwindSafe for DirichletCalibrator
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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