-
Notifications
You must be signed in to change notification settings - Fork 353
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
Issues with Markov Chain convergence and generated data in pycbc inference #4817
Comments
@Tobias-Reike About the first issue, with Second, can you explain better what you think the issue is? I don't quite follow. Were you expecting exactly the same simulated noise between two different programs, or is it that there seems to be more noise than anticipated at some frequency? If the former, I would not expect the same noise, since this is dependent on the pseudo-random number generator (PRNG) used and the seed provided. If the program you used to generate the data for the NN (= neural network?) uses a different PRNG or different seed than pycbc (which is likely), you'll have a different realization of noise. The best way to ensure you get the same realization is to generate a strain file using The other thing to keep in mind is that the data saved to the Anyway, if you could provide more details about your config file, and what you're trying to compare to, then we can try to figure out what the issue is. |
Hello, |
@Tobias-Reike Sorry to request more things, but could you attach one of your ASD files? |
@cdcapano ive got the noise asd file i used in pycbc_inference as asd_file.txt below. I created it when i did my data generation. For this I loaded some publically available ET asd file (see link in code part, also uploaded it this file as ET_asd_comb.txt) with the pycbc.psd.read.from_txt function and wrote a new file from the loaded psd. It has a lot of zeros before 30Hz. # noise psd: loaded the ET_D noise asd from https://www.et-gw.eu/index.php/etsensitivities, arXiv:1012.0908
# the oringinal file has both HF, LF and their combination. The loaded one only has the combination.
fs, duration = 2048, 5
df = 1 / duration
length = int(fs / 2 / df) + 1
noise_psd = from_txt(
'./ET_asd_comb.txt',
length,
df,
low_freq_cutoff=30,
is_asd_file=True
)
# example of how i wrote psd to asd_file.txt
f = open("asd_file.txt", "w")
for freq, power in zip(noise_psd.sample_frequencies, noise_psd**.5):
f.write(f'{freq:.18e} {power:.18e}\n') # wrote it this way to match with the formatting of the ET_D file from the link above
f.close() Just in case i also provided a python script illustrating how i made the comparison plot, where i opened the inference.hdf that was output by pycbc_inference, extracted the data from it, generated an event using get_td_waveform and colored_noise and plotted them both. |
Hello,
i have a few things which are troubling me with pycbc_inference. Ive been running it like the tutorial Simulated BBH example suggests, using pycbc_create_injections first and then running pycbc_inference.
My first issue with this was the reference frequency parameter. I set it to 0 first, since this is the default value in get_td_waveform() and ive been using it like this to generate data for my neural networks. So i wanted the parameter to match between my mcmc and NN. However whenever i set f_ref=0 pycbc_inference will not converge to the right BBH parameters, but to some values way off. This was true for at least 2 runs and interestingly the output values were very similar both times even though the injection parameters were different. When setting f_ref=f_lower=30 the mcmc converged nicely to the right parameters. So i guess i dont really understand the f_ref parameter, but it seems to have a strong effect on the run.
My second issue was with the data created by pycbc_inference. I had put in an own asd file to be used for noise like this:
fake-strain-from-file = E1:asd_file.txt E2:asd_file.txt E3:asd_file.txt
The asd_file is an asd i used during noise generation myself. I loaded another noise txt file and provided a length, df and lower freq in python and then i saved it as a txt:
psd = from_txt('./ET_asd_comb.txt', length, df, f_lower=30, is_asd_file=True)
I used this asd to generate data for my NN. Now when i use the asd in the mcmc and look at the data in the output file of pycbc_inference under ['data']['E1']['stilde'] and compare it to an event i generated for my NN, these events do not match. I can see very clearly that some frequencies below the f_lower=30 are prominent in the noise of the pycbc_inference data, that are not in my events (see plots, spec show mcmc data with significant values below 30Hz). This way i can not properly compare my mcmc posteriors with my NN posteriors. Am i doing something wrong with the asds?
The text was updated successfully, but these errors were encountered: