-
Notifications
You must be signed in to change notification settings - Fork 58
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 missing reverse-complement in reference sequence fetching for APARENT #336
Conversation
@haimasree should we just merge this? |
By all means! I did not intervene since Alex was assigned. The tests are passing so completely fine by me. I just merged the master branch. Lets see if the tests are still passing. |
Tests are passing it seems. Do you think this is wrong? |
Hm, this is super strange: Running the test in pycharm fails: /opt/anaconda/envs/kipoi-env/bin/python -m kipoi test . --batch_size=10 --source=dir
INFO [kipoi.data] Using user specified dataloader from LocalSource(local_path='/home/hoelzlwimmerf/Projects/kipoi/kipoi-models/APARENT/veff')
INFO [kipoi.data] successfully loaded the dataloader ././ from /home/hoelzlwimmerf/Projects/kipoi/kipoi-models/APARENT/veff/dataloader.py::Kipoi_APARENT_DL
INFO [kipoi.model] Downloading model arguments weights from https://github.com/johli/aparent/raw/8a884f0bc4073ed0edd588f71b61a5be4a37e831/saved_models/aparent_large_lessdropout_all_libs_no_sampleweights.h5
Using downloaded and verified file: /home/hoelzlwimmerf/Projects/kipoi/kipoi-models/APARENT/veff/downloaded/model_files/weights/31902fb40125679e655b8b6d2747ada7
2022-06-24 14:58:13.115952: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE4.1 SSE4.2 AVX AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
INFO [kipoi.pipeline] dataloader.output_schema is compatible with model.schema
INFO [kipoi.pipeline] Initialized data generator. Running batches...
INFO [kipoi.specs] Example file for argument fasta_file already exists
INFO [kipoi.specs] Example file for argument gtf_file already exists
INFO [kipoi.specs] Example file for argument vcf_file already exists
INFO [kipoi.specs] Example file for argument vcf_file_tbi already exists
0it [00:00, ?it/s]INFO [kipoi.pipeline] Returned data schema correct
42it [00:01, 35.43it/s]
0%| | 0/41 [00:00<?, ?it/s]INFO [kipoi.pipeline] predict_example done!
Using downloaded and verified file: /home/hoelzlwimmerf/Projects/kipoi/kipoi-models/APARENT/veff/downloaded/model_files/test.expect.h5
INFO [kipoi.cli.main] Testing if the predictions match the expected ones in the file: /home/hoelzlwimmerf/Projects/kipoi/kipoi-models/APARENT/veff/downloaded/model_files/test.expect.h5
INFO [kipoi.cli.main] Desired precision (number of matching decimal places): 4
ERROR [kipoi.cli.main] Model predictions don't match the expected predictions.expected: {'delta_logit_distal_prop': array([-0.19702771, 0.02928352, -0.3722965 , -0.56518483, -0.01937383,
0.23025364, 0.00450336, -0.01738143, 0.14959788, -0.08235216],
dtype=float32), 'delta_logit_proximal_prop': array([ 0.19702804, -0.02928317, 0.37229604, 0.5651839 , 0.01937395,
-0.23025393, -0.00450304, 0.01738191, -0.14959908, 0.08235168],
dtype=float32)}
observed: {'delta_logit_distal_prop': array([-0.19702801, 0.02928424, -0.372297 , -0.56518483, -0.01937269,
0.2302545 , 0.00450469, -0.01738 , 0.14959931, -0.08235478],
dtype=float32), 'delta_logit_proximal_prop': array([ 0.19702807, -0.02928376, 0.37229654, 0.5651847 , 0.01937279,
-0.23025477, -0.00450442, 0.01738119, -0.14960003, 0.08235312],
dtype=float32)}. Exception:
Arrays are not almost equal to 7 decimals
Mismatched elements: 9 / 10 (90%)
Max absolute difference: 2.6226044e-06
Max relative difference: 0.00029449
x: array([-0.197028 , 0.0292842, -0.372297 , -0.5651848, -0.0193727,
0.2302545, 0.0045047, -0.01738 , 0.1495993, -0.0823548],
dtype=float32)
y: array([-0.1970277, 0.0292835, -0.3722965, -0.5651848, -0.0193738,
0.2302536, 0.0045034, -0.0173814, 0.1495979, -0.0823522],
dtype=float32)
0%| | 0/41 [00:00<?, ?it/s]
Process finished with exit code 1 Running it in the terminal works:
How is that possible? @haimasree can we somehow obtain the testing predictions? /opt/anaconda/envs/kipoi-env/bin/python -m kipoi test . --batch_size=10 --source=dir -o /tmp/APARENT.veff.predictions.hdf5
INFO [kipoi.data] Using user specified dataloader from LocalSource(local_path='/home/hoelzlwimmerf/Projects/kipoi/kipoi-models/APARENT/veff')
INFO [kipoi.data] successfully loaded the dataloader ././ from /home/hoelzlwimmerf/Projects/kipoi/kipoi-models/APARENT/veff/dataloader.py::Kipoi_APARENT_DL
INFO [kipoi.model] Downloading model arguments weights from https://github.com/johli/aparent/raw/8a884f0bc4073ed0edd588f71b61a5be4a37e831/saved_models/aparent_large_lessdropout_all_libs_no_sampleweights.h5
Using downloaded and verified file: /home/hoelzlwimmerf/Projects/kipoi/kipoi-models/APARENT/veff/downloaded/model_files/weights/31902fb40125679e655b8b6d2747ada7
2022-06-24 15:08:11.312341: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE4.1 SSE4.2 AVX AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
INFO [kipoi.pipeline] dataloader.output_schema is compatible with model.schema
INFO [kipoi.pipeline] Initialized data generator. Running batches...
INFO [kipoi.specs] Example file for argument fasta_file already exists
INFO [kipoi.specs] Example file for argument gtf_file already exists
INFO [kipoi.specs] Example file for argument vcf_file already exists
INFO [kipoi.specs] Example file for argument vcf_file_tbi already exists
INFO [kipoi.pipeline] Returned data schema correct
42it [00:01, 34.07it/s]
INFO [kipoi.pipeline] predict_example done!
INFO [kipoi.cli.main] Successfully ran test_predict |
Okay this is indeed strange.
and |
@Hoeze in your pycharm version - precision_decimal is 7 which is the default value. So, somehow So: Terminal: INFO [kipoi.cli.main] Desired precision (number of matching decimal places): 4 Now I dont why its like that. Any thoughts? |
@Hoeze Any update on this? Shall I just merge? |
I'll merge now, but this definitely needs more debugging. Still, I'm limited on time and I dont know when I can come back to this issue... |
Same upto 4 decimal places but not 7 ;) |
fix missing reverse-complement in reference sequence fetching for APARENT
fix missing reverse-complement in reference sequence fetching for APARENT
Ensure that the ref-sequence is reverse-complemented