pub struct SharedSiteCrossover {
pub n_pairs: usize,
pub swap_probability: f64,
}Expand description
Structure-safe crossover population kernel: fugue’s [fugue::CrossoverKernel]
move (pick two distinct particles, exchange the block of choices at a
masked address set, accept the pair with the product-target Metropolis
ratio) with the mask of shared_site_crossover_mask and a
completeness-checked re-score (fugue’s reconciling scorer plus its
fresh/vanished report) in place of fugue’s panicking one.
A proposal is rejected outright when either child fails to re-score as a
complete execution over its own pre-swap address set — the model visited
an address the child does not hold (a structural site whose new value
opened a branch), or left some of the child’s choices unvisited (a branch
closed). Every accepted pair therefore has exactly the parents’ address
sets, so the swap is an involution on the state space and the mask
distribution is the same in both directions: the move is symmetric and
leaves the product of tempered targets invariant; the rejected proposals
are self-loops, which detailed balance ignores. This is what
EvoSmcConfig::crossover builds, so EvolutionSMC::run / anneal
with EvoSmcConfig::default() are safe on any GenomePrior.
Fields§
§n_pairs: usizeNumber of (pair, swap) proposals per sweep.
swap_probability: f64Per-address probability that a shared site joins the swap mask.
Trait Implementations§
Source§fn clone(&self) -> SharedSiteCrossover
fn clone(&self) -> SharedSiteCrossover
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§fn from(cfg: &CrossoverConfig) -> Self
fn from(cfg: &CrossoverConfig) -> Self
Source§fn sweep(
&mut self,
rng: &mut dyn RngCore,
particles: &mut [Particle],
model_fn: &dyn Fn() -> Model<A>,
beta: f64,
)
fn sweep( &mut self, rng: &mut dyn RngCore, particles: &mut [Particle], model_fn: &dyn Fn() -> Model<A>, beta: f64, )
beta is the current tempering
exponent; model_fn reconstructs the single-execution model whose
tempered density defines the (product) target. Read more§fn is_identity(&self) -> bool
fn is_identity(&self) -> bool
true iff sweep is a no-op, so the driver may skip the tempering
ladder entirely when there is also no per-particle rejuvenation (the
FG-43 single-reweight shortcut). Defaults to false; only
[NoKernel] overrides it. A kernel that moves particles must not
return true: with rejuvenation_steps == 0 the shortcut would
otherwise silently skip it (FG-N3).Auto Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.