Struct smoothed_online_convex_optimization::cost::CostFn [−][src]
pub struct CostFn<'a, T, C, D>(_);
Expand description
Cost functions that arrived over time. Individual cost functions may have different domains. For example, in a predictive online setting, a cost function arriving at time $t$ generally has the domain $[t, t + w]$.
Implementations
impl<'a, T, C, D> CostFn<'a, T, C, D> where
T: Clone,
C: ModelOutputSuccess,
D: ModelOutputFailure,
impl<'a, T, C, D> CostFn<'a, T, C, D> where
T: Clone,
C: ModelOutputSuccess,
D: ModelOutputFailure,
Creates initial cost function from some time $t \geq 1$.
Adds a new cost function which may return uncertain predictions. Must always return at least one sample (which corresponds to certainty).
Returns mean if cost function returns a prediction.
Computes certain cost.
Computes uncertain cost.
pub fn call_mean_within_bounds<B>(&self, t: i32, x: T, bounds: &B) -> Cost<C, D> where
B: DecisionSpace<'a, T>,
pub fn call_mean_within_bounds<B>(&self, t: i32, x: T, bounds: &B) -> Cost<C, D> where
B: DecisionSpace<'a, T>,
Returns mean if cost function returns a prediction while ensuring that the given parameter is within the decision space.
pub fn call_certain_within_bounds<B>(
&self,
t: i32,
x: T,
bounds: &B
) -> Cost<C, D> where
B: DecisionSpace<'a, T>,
pub fn call_certain_within_bounds<B>(
&self,
t: i32,
x: T,
bounds: &B
) -> Cost<C, D> where
B: DecisionSpace<'a, T>,
Computes certain cost while ensuring that the given parameter is within the decision space.
pub fn call_predictive_within_bounds<B>(
&self,
t: i32,
x: T,
bounds: &B
) -> Vec<Cost<C, D>> where
B: DecisionSpace<'a, T>,
pub fn call_predictive_within_bounds<B>(
&self,
t: i32,
x: T,
bounds: &B
) -> Vec<Cost<C, D>> where
B: DecisionSpace<'a, T>,
Computes uncertain cost while ensuring that the given parameter is within the decision space.
Trait Implementations
impl<'a, C, D> DiscretizableCostFn<'a, C, D> for CostFn<'a, FractionalConfig, C, D> where
C: ModelOutputSuccess + 'a,
D: ModelOutputFailure + 'a,
impl<'a, C, D> DiscretizableCostFn<'a, C, D> for CostFn<'a, FractionalConfig, C, D> where
C: ModelOutputSuccess + 'a,
D: ModelOutputFailure + 'a,
Discretize a certain fractional cost function.
impl<'a, C, D> RelaxableCostFn<'a, C, D> for CostFn<'a, IntegralConfig, C, D> where
C: ModelOutputSuccess + 'a,
D: ModelOutputFailure + 'a,
impl<'a, C, D> RelaxableCostFn<'a, C, D> for CostFn<'a, IntegralConfig, C, D> where
C: ModelOutputSuccess + 'a,
D: ModelOutputFailure + 'a,
Relax a certain integral cost function to the fractional setting.
impl<'a, T, C, D> ResettableCostFn<'a, T, C, D> for CostFn<'a, T, C, D> where
T: Clone,
C: ModelOutputSuccess,
D: ModelOutputFailure,
impl<'a, T, C, D> ResettableCostFn<'a, T, C, D> for CostFn<'a, T, C, D> where
T: Clone,
C: ModelOutputSuccess,
D: ModelOutputFailure,
Auto Trait Implementations
impl<'a, T, C, D> !RefUnwindSafe for CostFn<'a, T, C, D>
impl<'a, T, C, D> !UnwindSafe for CostFn<'a, T, C, D>
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.