Skip to content

Compute log-likelihood for less samples #17

Description

@OttoVintola

The idea is to only compute the log-likelihood for the samples that fall into the tree instead of over all samples.

In weight.rs we use a function pointer to a PyMC weight function and then call it with

    fn log_weight(&self, predictions: &[f64]) -> f64 {
        unsafe { (self.func_ptr)(predictions.as_ptr(), predictions.len()) }
    }

However, the log likelihood of the samples that are not assigned to the mutated tree during SMC, remain the same from the previous iteration. Thus, they are being computed for no reason again.

According to the PyTensor folks, a solution could be to use a subtensor lift in from PyTensor.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions