pub struct CoarseToFineRouter<'a> { /* private fields */ }Expand description
粗密二段階階層ルーティングを実行するオーケストレータ。
Implementations§
Source§impl<'a> CoarseToFineRouter<'a>
impl<'a> CoarseToFineRouter<'a>
Sourcepub fn new(
engine: &'a InferenceEngine,
tokenizer: &'a JevTokenizer,
mapping: &'a HierarchicalMapping,
calib_config: &'a CalibrationConfig,
config: HierarchicalRouterConfig,
) -> Result<Self>
pub fn new( engine: &'a InferenceEngine, tokenizer: &'a JevTokenizer, mapping: &'a HierarchicalMapping, calib_config: &'a CalibrationConfig, config: HierarchicalRouterConfig, ) -> Result<Self>
新しいルーターインスタンスを単一推論エンジンから生成する。
Sourcepub fn new_dual(
engine: &'a DualSessionEngine,
cached_state: &'a CachedStateFeatures,
tokenizer: &'a JevTokenizer,
mapping: &'a HierarchicalMapping,
calib_config: &'a CalibrationConfig,
config: HierarchicalRouterConfig,
) -> Result<Self>
pub fn new_dual( engine: &'a DualSessionEngine, cached_state: &'a CachedStateFeatures, tokenizer: &'a JevTokenizer, mapping: &'a HierarchicalMapping, calib_config: &'a CalibrationConfig, config: HierarchicalRouterConfig, ) -> Result<Self>
キャッシュ済み中間特徴量を保持するデュアルセッションエンジンから新しいルーターインスタンスを生成する。
Sourcepub fn with_backend(
backend: HierarchicalEngine<'a>,
tokenizer: &'a JevTokenizer,
mapping: &'a HierarchicalMapping,
calib_config: &'a CalibrationConfig,
config: HierarchicalRouterConfig,
) -> Result<Self>
pub fn with_backend( backend: HierarchicalEngine<'a>, tokenizer: &'a JevTokenizer, mapping: &'a HierarchicalMapping, calib_config: &'a CalibrationConfig, config: HierarchicalRouterConfig, ) -> Result<Self>
任意の推論バックエンドからルーターインスタンスを生成する。
Sourcepub fn route(
&self,
state: &str,
instructions: &str,
gating_config: Option<&GatingConfig>,
) -> Result<HierarchicalResult>
pub fn route( &self, state: &str, instructions: &str, gating_config: Option<&GatingConfig>, ) -> Result<HierarchicalResult>
階層ルーティング推論を実行する。
§パイプライン
- 第 1 パス (大分類推論 & Dirichlet 較正):
ModelDrivenCoarseScorerで大分類確率を算出し、設定に応じて ODIR Dirichlet 較正を適用。 - Early-Exit 判定: 複合確信度 $S_{\text{coarse}} < \tau_{\text{escalate}}$ の場合、即時脱出。
- Soft-Beam 判定: Top-Margin $M_{\text{coarse}} < \tau_{\text{beam}}$ の場合、Top-1 と Top-2 配下の候補をマージ。
- 第 2 パス (細分類推論 & 生ロジット取得): マージされた候補群に対して生ロジットを直接抽出。
- 温度調整 & 確率結合: エントロピー連動温度・ベース温度を生ロジットへ直接適用 (1 回の Softmax) し、大分類確率と減衰周辺化結合。
- 受け皿候補バイアス: $P(\text{その他}) \ge \tau_{\text{catchall}}$ 判定。
- 全候補空間 Gating 再計算: 全細分類候補空間基準で Gating メタデータを正規化。
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for CoarseToFineRouter<'a>
impl<'a> !UnwindSafe for CoarseToFineRouter<'a>
impl<'a> Freeze for CoarseToFineRouter<'a>
impl<'a> Send for CoarseToFineRouter<'a>
impl<'a> Sync for CoarseToFineRouter<'a>
impl<'a> Unpin for CoarseToFineRouter<'a>
impl<'a> UnsafeUnpin for CoarseToFineRouter<'a>
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<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