Skip to content

Vectorizing GP bases/design matrices for chromatic modeling (interpolation and ecorr) #420

@blarsen10

Description

@blarsen10

Hopefully I'm not too off base with this, but a couple of the functions to create GP bases in enterprise seem like they are unnecessarily slow because they are not vectorized (i.e. they contain for loops). My understanding is this is usually okay because the bases are typically created once during the first likelihood call and then cached. However, its now becoming more common in noise modeling to allow the radio frequency scaling index of a chromatic process to vary, which I think means recreating the GP basis for every new idx sample. For example, calling enterprise.signals.createfourierdesignmatrix_chromatic and allowing the idx parameter to vary in MCMC should be recreating the design matrix several times. Thankfully the function to create the Fourier design matrix, createfourierdesignmatrix_red is already vectorized, therefore this is relatively efficient. However, not all the functions for creating bases are vectorized yet, and if they are used for chromatic noise modeling this is an extra inefficiency that can be fixed. The only 2 commonly used bases I found that are not vectorized are the interpoaltion and ECORR bases:

  • enterprise.signals.utils.linear_interp_basis. This seems like a problem if using linear_interp_basis_chromatic in enterprise_extensions with varied idx during MCMC. Vectorizing this seems doable.
  • enterprise.signals.utils.create_quantization_matrix. This is usually used for ECORR. As far I know this is not used yet for varied chromatic index modeling, but it might be useful for that purpose in the near future! The way this is written looks like it might be tricky to vectorize though?

Maybe there are other bases that should be included in this list? Jeremy has also been working on better caching of the chromatic basis which will also help a lot with this, though I think that would belong better in a separate issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions