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

GW figures #1

Open
aurelio-amerio opened this issue Dec 14, 2024 · 1 comment
Open

GW figures #1

aurelio-amerio opened this issue Dec 14, 2024 · 1 comment

Comments

@aurelio-amerio
Copy link

Good afternoon, very interesting paper.
I'm trying to reproduce the results for the GW experiment, and it seems that the .pt files for the dataset are missing in the figures/fig_appendix/gravitational_waves folder. Could you please upload the dataset to github aswell, in order to be able to reproduce the figures?

Thank you very much for your help!

@manuelgloeckler
Copy link
Collaborator

Dear Aurelio,

Thanks for your interest, and sorry for the late reply. Unfortunately, the dataset files for this experiment are too large to upload on GitHub. You can reproduce it using the following code.

You could generate the dataset using the following code (for idx 0-9):

import hypothesis
from hypothesis.benchmark.gravitational_waves import Simulator, Prior
import multiprocessing
import sys
import torch

NUM_SIMS = 10_000

prior = Prior()
simulator = Simulator()


def run_sim(i):
    torch.manual_seed(i)
    thetas = prior.sample((1,))
    xs = simulator(thetas.to("cpu"))
    return thetas, xs

# Run the simulator on multiple cores

if __name__ == "__main__":
    idx = int(sys.argv[1])  # Read in the first argument
    print(idx)
    with multiprocessing.Pool(multiprocessing.cpu_count()) as p:
        results = p.map(run_sim, range(idx*NUM_SIMS, (idx+1)*NUM_SIMS))  
    thetas, xs = zip(*results)
    thetas = torch.concat(thetas)
    xs = torch.concat(xs)
    torch.save(thetas, f"thetas_{idx}.pt")
    torch.save(xs, f"xs_{idx}.pt")
    print(thetas)
    print(xs)

I uploaded the used dataset to a cloud that is available to me (https://nc.mlcloud.uni-tuebingen.de/index.php/s/scGPkpmXiMajfEH).

Kind regards,
Manuel

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