pub struct EnvelopeReweightPolicy {
pub weight_fraction: f64,
pub scale: ReweightScale,
}Expand description
How observed losses reweight their Pauli-envelope edges.
Fields§
§weight_fraction: f64Exponent applied to each observed loss’s Pauli-envelope edges,
equivalently the fraction of the edge’s own scale weight it is lowered
to. Near 1 the loss edges barely help; near 0 they become free
and the decoder chains them into logical errors.
scale: ReweightScaleWhich scale weight the fraction is taken of.
Implementations§
Source§impl EnvelopeReweightPolicy
impl EnvelopeReweightPolicy
pub fn new(weight_fraction: f64) -> Self
Sourcepub fn scaled_probability(self, scale_weight: f64) -> f64
pub fn scaled_probability(self, scale_weight: f64) -> f64
Apply the configured fraction to a supplied scale weight.
Sourcepub fn locally_reweighted_probability(
self,
edge_probability: f64,
activation_probability: f64,
) -> f64
pub fn locally_reweighted_probability( self, edge_probability: f64, activation_probability: f64, ) -> f64
Reweight against the edge’s own prior combined with its activation.
Trait Implementations§
Source§impl Clone for EnvelopeReweightPolicy
impl Clone for EnvelopeReweightPolicy
impl Copy for EnvelopeReweightPolicy
Source§impl Debug for EnvelopeReweightPolicy
impl Debug for EnvelopeReweightPolicy
Source§impl Default for EnvelopeReweightPolicy
impl Default for EnvelopeReweightPolicy
Source§impl<'de> Deserialize<'de> for EnvelopeReweightPolicy
impl<'de> Deserialize<'de> for EnvelopeReweightPolicy
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 EnvelopeReweightPolicy
impl PartialEq for EnvelopeReweightPolicy
Source§impl Serialize for EnvelopeReweightPolicy
impl Serialize for EnvelopeReweightPolicy
impl StructuralPartialEq for EnvelopeReweightPolicy
Auto Trait Implementations§
impl Forget for EnvelopeReweightPolicy
impl Freeze for EnvelopeReweightPolicy
impl Move for EnvelopeReweightPolicy
impl RefUnwindSafe for EnvelopeReweightPolicy
impl Send for EnvelopeReweightPolicy
impl Sync for EnvelopeReweightPolicy
impl Unpin for EnvelopeReweightPolicy
impl UnsafeUnpin for EnvelopeReweightPolicy
impl UnwindSafe for EnvelopeReweightPolicy
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request