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

Fix test output of reduced basis #45

Closed
max-dax opened this issue Feb 9, 2022 · 2 comments
Closed

Fix test output of reduced basis #45

max-dax opened this issue Feb 9, 2022 · 2 comments

Comments

@max-dax
Copy link
Collaborator

max-dax commented Feb 9, 2022

When generating the SVD for (a) compression of the dataset and (b) initialisation of the first network layer, we need to make sure that the basis is sufficiently accurate. The method SVDBasis.test_basis() is intended for this purpose, however at the moment it is pretty messy with print statements and saved data. Need to clean this up.

The test_basis method should maybe have two modes:

  • The minimal test, testing only with the maximal number of basis elements. It could either print the mismatches, or just check whether they are below a particular threshold. This should be run whenever generating and using a reduced basis, i.e. for (a) and for (b).
  • A detailed test that allows for better analysis. E.g., when generating a dataset with a new waveform model, or a new prior, one does not know how many basis elements are necessary. The detailed test should scan the mismatches with a variety of n_svd (default could e.g. be n_svd in [2**i for i in range(5, i_max)]). In addition, there should be an option to save the array of mismatches along with the parameters. This would help to analyse in which part of the parameter space the reduced basis fails. It would also be necessary to determine what prior on particular parameters (e.g., chirp mass) is feasible for a specific n_svd.
@max-dax
Copy link
Collaborator Author

max-dax commented Feb 9, 2022

For dataset generation, this could also be used to (automatically?) determine how many basis elements are necessary. One could add an option to WaveformDataset to truncate a loaded dataset to a smaller number of basis elements, which would speed up preprocessing.

@stephengreen
Copy link
Contributor

I agree we should overhaul the SVDBasis class. In particular, if we make it subclass DingoDataset we can more easily save additional diagnostic information along with the V matrix, and we can also output all of this as a dictionary and save it along with a WaveformDataset. The new class could also have a method to truncate itself at a smaller number of basis elements.

I'm happy to work on this.

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

2 participants