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

PolyChord + Proposal #115

Draft
wants to merge 70 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
48a1362
Added a *very* simple test.
appetrosyan Oct 11, 2020
b03648e
Added minimal skeleton for changes.
appetrosyan Oct 11, 2020
2412b87
Re-added the comments
appetrosyan Oct 11, 2020
5a929d7
Moved use_supernest into object scope.
appetrosyan Oct 12, 2020
1d9dd5c
polychord: inherits from CovmatSampler and loads covmat
JesusTorrado Nov 26, 2020
5da5221
supernest: mean by default prior.reference()
JesusTorrado Nov 26, 2020
9e5b326
polychord: added mean as dict
JesusTorrado Dec 28, 2020
7d2a2be
polychord: mean and covmat prep moved to `initialize`
JesusTorrado Dec 28, 2020
3f331c5
Added credit.
appetrosyan Feb 19, 2021
9d77f3f
Started some small changes.
appetrosyan Feb 24, 2021
aaf6a2f
Formatting issues.
appetrosyan Mar 21, 2021
9fe5cab
Formatting.
appetrosyan Mar 21, 2021
6ac6c94
Formatting.
appetrosyan Mar 21, 2021
c947291
Found redundant if-statement.
appetrosyan Mar 21, 2021
3ee0b20
https://www.python.org/dev/peps/pep-0257/
appetrosyan Mar 21, 2021
206151c
Docstring format.
appetrosyan Mar 21, 2021
3704edb
Docstring improvements.
appetrosyan Mar 21, 2021
4954624
Even better docstring.
appetrosyan Mar 21, 2021
333ccc9
Even better better docstring.
appetrosyan Mar 21, 2021
548fe5d
Formatting.
appetrosyan Mar 21, 2021
2f7e73d
Further formatting improvements.
appetrosyan Mar 21, 2021
bc74ac5
Fix formatting.
appetrosyan Mar 21, 2021
ce04527
Supernest API fixes.
appetrosyan Mar 21, 2021
e37cc4f
Bugfix.
appetrosyan Mar 22, 2021
eaa3898
Added a dump paramnames.
appetrosyan Mar 29, 2021
21b1f25
small irrelevant change
appetrosyan Mar 29, 2021
a13b052
removed accidental commit of .mypy cache
appetrosyan Mar 29, 2021
217fe19
Small irrelevant change
appetrosyan Mar 29, 2021
c6d9ff1
Small irrelevant change
appetrosyan Mar 29, 2021
5b0d409
Small irrelevant change
appetrosyan Mar 29, 2021
0077e50
Small irrelevant change
appetrosyan Mar 29, 2021
adf0f45
Fix for the paramnames being messed up.
appetrosyan Mar 29, 2021
b1bf18f
Fixed graceful exit to an ungraceful failure.
appetrosyan Mar 30, 2021
d7dbdf2
Fix for the paramnames being messed up.
appetrosyan Mar 29, 2021
a024a7c
Fixed graceful exit to an ungraceful failure.
appetrosyan Mar 30, 2021
07d8f23
Added Will to the credits.
appetrosyan Mar 30, 2021
687fe51
Merge remote-tracking branch 'origin/polychord_proposal' into polycho…
appetrosyan Mar 31, 2021
dd3b3ed
Preliminary fixes.
appetrosyan Mar 31, 2021
db54368
Paramnames fix.
appetrosyan Mar 31, 2021
3595928
Supernest changes.
appetrosyan Mar 31, 2021
89612b4
Removed formatting "fixes".
appetrosyan Mar 31, 2021
5545d0c
Merge remote-tracking branch 'origin/polychord_proposal' into polycho…
appetrosyan Mar 31, 2021
27cfccd
Added .DS_Store ignore.
appetrosyan Apr 12, 2021
29b8f35
Merge remote-tracking branch 'origin/master' into polychord_proposal
appetrosyan Apr 12, 2021
b8937e6
Added a likelihood sanity check.
appetrosyan Apr 12, 2021
140e784
Removed exception bubbling.
appetrosyan Apr 13, 2021
1def68a
Added a debug message.
appetrosyan Apr 13, 2021
dae2248
Added a debug message.
appetrosyan Apr 13, 2021
c806e86
Merge remote-tracking branch 'origin/polychord_proposal' into polycho…
appetrosyan Apr 13, 2021
0a38dff
Bugfixes.
appetrosyan Apr 13, 2021
9c75d5b
Fixed a bug where the models weren't initialised.
appetrosyan Apr 14, 2021
e58a292
Removed unnecessary comment.
appetrosyan Apr 14, 2021
2735e2e
Fixed dimensionality for one proposal.
appetrosyan Apr 15, 2021
01d4128
Fixed formatting.
appetrosyan Apr 30, 2021
e79bc09
Fixed a blocking issue.
appetrosyan Apr 30, 2021
1e8de70
Clarified error message
appetrosyan May 3, 2021
2e1c1c4
Reverted a mistake.
appetrosyan May 3, 2021
5510a52
Whitespace.
appetrosyan May 3, 2021
0b44b5b
Fixed oversampling regression.
appetrosyan May 18, 2021
caea3b2
Merge remote-tracking branch 'origin/polychord_proposal' into polycho…
appetrosyan May 18, 2021
0a6be5a
Grade_frac experiment.
appetrosyan May 21, 2021
4667410
Merged from Master.
appetrosyan Jun 23, 2021
847c62e
Fixed problematic settings creation.
appetrosyan Jul 14, 2021
32aac84
[polychord] added option to import supernest.
appetrosyan Jul 14, 2021
269fa7f
[sampler] more granular debugging message for covmat.
appetrosyan Jul 14, 2021
a62f0f9
[sampler] even more granularity.
appetrosyan Jul 14, 2021
e5d7145
[sampler] fixed typo
appetrosyan Jul 14, 2021
084c57f
[polychord] fixed supernest `.paramenames` regression.
appetrosyan Jul 18, 2021
3b55b92
[polychord] updated to work with supernest v3.0.0.
appetrosyan Aug 2, 2021
e654b95
Docstring format.
appetrosyan Aug 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ tests/.ipynb_checkpoints

# pytest
.cache
/cobaya/samplers/polychord/.mypy_cache/
.*/.DS_.*
/cobaya/.DS_Store
/cobaya/samplers/.DS_Store
/.DS_Store
2 changes: 1 addition & 1 deletion cobaya/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ def check_blocking(self, blocking):
oversampling_factors, blocks = zip(*list(blocking))
except:
raise LoggedError(
self.log, "Manual blocking not understood. Check documentation.")
self.log, f"Manual blocking not understood: {list(blocking)} is not an acceptable specification.")
sampled_params = list(self.sampled_dependence)
check = are_different_params_lists(list(chain(*blocks)), sampled_params)
duplicate = check.pop("duplicate_A", None)
Expand Down
16 changes: 12 additions & 4 deletions cobaya/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def delete_output_files(cls, output, info=None):
for (regexp, root) in cls.output_files_regexps(output, info=info):
# Special case: CovmatSampler's may have been given a covmat with the same
# name that the output one. In that case, don't delete it!
if issubclass(cls, CovmatSampler) and info:
if issubclass(cls, CovmatSampler) and info and regexp:
if regexp.pattern.rstrip("$").endswith(Extension.covmat):
covmat_file = info.get("covmat", "")
if (isinstance(covmat_file, str) and covmat_file ==
Expand Down Expand Up @@ -509,14 +509,22 @@ def initial_proposal_covmat(self, auto_params=None):
self.log, "The number of parameters in %s and the "
"dimensions of the matrix do not agree: %d vs %r",
str_msg, len(loaded_params), loaded_covmat.shape)
if not (np.allclose(loaded_covmat.T, loaded_covmat) and
np.all(np.linalg.eigvals(loaded_covmat) > 0)):
if not np.allclose(loaded_covmat.T, loaded_covmat):
str_msg = "passed"
if isinstance(self.covmat, str):
str_msg = "loaded from %r" % self.covmat
raise LoggedError(
self.log, "The covariance matrix %s is not a positive-definite, "
self.log, "The covariance matrix %s is not a "
"symmetric square matrix.", str_msg)
if not np.all(np.linalg.eigvals(loaded_covmat) > 0):
self.log.debug(loaded_covmat)
self.log.debug(np.linalg.eigvals(loaded_covmat))
str_msg = "passed"
if isinstance(self.covmat, str):
str_msg = "loaded from %r" % self.covmat
raise LoggedError(
self.log, "The covariance matrix %s is not a "
"positive definite matrix.", str_msg)
# Fill with parameters in the loaded covmat
renames = {p: [p] + str_to_list(v.get("renames") or [])
for p, v in params_infos.items()}
Expand Down
Loading