pub enum Outcome {
Success {
score: f64,
},
Failure {
reason: String,
},
Timeout {
partial_score: Option<f64>,
},
Aggregated {
success_rate: f64,
total_tasks: u32,
successful_tasks: u32,
total_ticks: u32,
},
Unknown,
}Expand description
エピソードの結果
LearnModel::evaluate() で判定される。
§構造
- Single Task: Success / Failure / Timeout
- Multiple Tasks: Aggregated
- 未判定: Unknown
Variants§
Success
成功(1 Task)
Failure
失敗(1 Task)
Timeout
タイムアウト(1 Task)
Aggregated
複数 Task の集約結果
Eval 実行後に複数タスクの結果を集約して評価する場合に使用。
Fields
Unknown
不明(判定できない場合)
Implementations§
Source§impl Outcome
impl Outcome
pub fn success(score: f64) -> Outcome
pub fn success_binary() -> Outcome
pub fn failure(reason: impl Into<String>) -> Outcome
pub fn timeout(partial_score: Option<f64>) -> Outcome
Sourcepub fn aggregated(
success_rate: f64,
total_tasks: u32,
successful_tasks: u32,
total_ticks: u32,
) -> Outcome
pub fn aggregated( success_rate: f64, total_tasks: u32, successful_tasks: u32, total_ticks: u32, ) -> Outcome
複数 Task の集約結果を作成
Sourcepub fn from_eval_result(
total_tasks: u32,
successful_tasks: u32,
success_rate: f64,
total_ticks: u32,
) -> Outcome
pub fn from_eval_result( total_tasks: u32, successful_tasks: u32, success_rate: f64, total_ticks: u32, ) -> Outcome
複数 Task の集計結果から Aggregated を作成
注意: このメソッドは複数 Task の集計結果用です。 1 Task の結果には以下を使用してください:
Outcome::success(score)- タスク成功Outcome::failure(reason)- タスク失敗Outcome::timeout(partial_score)- タイムアウト
§Arguments
total_tasks: 総タスク数(2 以上を想定)successful_tasks: 成功タスク数success_rate: 成功率(0.0〜1.0)total_ticks: 合計 Tick 数
§Example
ⓘ
// DPO 学習: 同じ GroupId で 5 回実行した結果を集計
let outcome = Outcome::from_eval_result(5, 4, 0.8, 250);pub fn is_success(&self) -> bool
pub fn is_failure(&self) -> bool
Sourcepub fn is_aggregated(&self) -> bool
pub fn is_aggregated(&self) -> bool
Aggregated かどうか
Sourcepub fn is_aggregated_success(&self, threshold: f64) -> bool
pub fn is_aggregated_success(&self, threshold: f64) -> bool
Aggregated で閾値以上の成功率かどうか
Sourcepub fn is_aggregated_failure(&self, threshold: f64) -> bool
pub fn is_aggregated_failure(&self, threshold: f64) -> bool
Aggregated で閾値未満の成功率かどうか
Sourcepub fn success_rate(&self) -> Option<f64>
pub fn success_rate(&self) -> Option<f64>
成功率を取得(Aggregated 専用)
Single Task (Success/Failure/Timeout) では None を返す。
Single Task のスコアは score() を使用すること。
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Outcome
impl<'de> Deserialize<'de> for Outcome
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Outcome, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Outcome, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Outcome
impl Serialize for Outcome
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Outcome
impl RefUnwindSafe for Outcome
impl Send for Outcome
impl Sync for Outcome
impl Unpin for Outcome
impl UnwindSafe for Outcome
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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