pub struct CompressionParams {
pub pseudocounts: u64,
pub topk: usize,
pub structure_penalty: f64,
pub topk_use_only_likelihood: bool,
pub aic: f64,
pub arity: u32,
}
Expand description
Parameters for grammar induction.
Proposed grammars are scored as likelihood - aic * #primitives - structure_penalty * #nodes
.
Additionally, pseudocounts
affects the likelihood calculation, and topk
and arity
affect
what fragments can be proposed.
Fields§
§pseudocounts: u64
Pseudocounts are added to the observed counts associated with each primitive and invented expression.
topk: usize
Rather than using every expression in the frontier for proposing fragments, only use the
topk
best expressions in each frontier.
structure_penalty: f64
Structure penalty penalizes the total number of nodes in each Expression
of the
grammar’s primitives and invented expressions.
topk_use_only_likelihood: bool
Determines whether to use the maximum a-posteriori value for topk evaluation, or whether to
use only the likelihood. Leave this to false
unless you know what you are doing.
aic: f64
AIC is a penalty in the number of parameters, i.e. the number of primitives and invented expressions.
arity: u32
Arity is the largest applicative depth of an expression that may be manipulated to propose a fragment.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompressionParams
impl RefUnwindSafe for CompressionParams
impl Send for CompressionParams
impl Sync for CompressionParams
impl Unpin for CompressionParams
impl UnwindSafe for CompressionParams
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> 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