Struct programinduction::lambda::CompressionParams[][src]

pub struct CompressionParams {
    pub pseudocounts: u64,
    pub topk: usize,
    pub structure_penalty: f64,
    pub topk_use_only_likelihood: bool,
    pub joint_mdl_use_only_likelihood: bool,
    pub aic: f64,
    pub arity: u32,
}

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 are added to the observed counts associated with each primitive and invented expression.

Rather than using every expression in the frontier for proposing fragments, only use the topk best expressions in each frontier.

Structure penalty penalizes the total number of nodes in each Expression of the grammar's primitives and invented expressions.

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.

Determines whether to use the maximum a-posteriori value for the scoring of fragments, or whether to use only the likelihood. Leave this to false unless you know what you are doing.

AIC is a penalty in the number of parameters, i.e. the number of primitives and invented expressions.

Arity is the largest applicative depth of an expression that may be manipulated to propose a fragment.

Trait Implementations

impl Default for CompressionParams
[src]

The default params prevent completely discarding of primives by having non-zero pseudocounts.

CompressionParams {
    pseudocounts: 5,
    topk: 2,
    topk_use_only_likelihood: false,
    joint_mdl_use_only_likelihood: false,
    structure_penalty: 1f64,
    aic: 1f64,
    arity: 2,
}

Auto Trait Implementations