Skip to content

Caching problem with _inv_cdf_func #31

@sgherbst

Description

@sgherbst

It is currently not possible to have different settings for num_sigma, lfsr_width, func_order, and func_numel for Gaussian noise generators due to how _inv_cdf_func is cached in MixedSignalModel:

msdsl/msdsl/model.py

Lines 373 to 381 in 58964b3

if self._inv_cdf_func is None:
inv_cdf = lambda x: truncnorm.ppf(x, -num_sigma, +num_sigma)
domain = [apply_compression(0), apply_compression((1<<(lfsr_width-1))-1)]
self._inv_cdf_func = self.make_function(
lambda x: inv_cdf(invert_compression(x)/(1<<lfsr_width)),
domain=domain,
order=func_order,
numel=func_numel
)

We should make the caching more flexible so that it knows about the values of those four settings for each cache entry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions