Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching problem with _inv_cdf_func #31

Open
sgherbst opened this issue Feb 8, 2021 · 0 comments
Open

Caching problem with _inv_cdf_func #31

sgherbst opened this issue Feb 8, 2021 · 0 comments

Comments

@sgherbst
Copy link
Owner

sgherbst commented Feb 8, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant