Closed claudio-ICL closed 1 year ago
Hi @Mbompr
I am trying to adapt the code of HawkesCumulantMatching
to tensorflow v2. There are some tests that fail however, because the numerical precision is not achieved. I was wondering whether you can explain how the expected values were produced?
If I remember correctly, these values have been obtained by making the algorithm run. I think that if the new values are close enough, we can simply replace them. Maybe the optimization loop has changed with TF2.
If I remember correctly, these values have been obtained by making the algorithm run. I think that if the new values are close enough, we can simply replace them. Maybe the optimization loop has changed with TF2.
Understood. So, they are not ground truth. From a first run with v2 I get somewhat similar values, but the precision of 6 decimal places is certainly lost.
I think it makes sense to change the values in the test within the PR then
If I remember correctly, these values have been obtained by making the algorithm run. I think that if the new values are close enough, we can simply replace them. Maybe the optimization loop has changed with TF2.
Understood. So, they are not ground truth. From a first run with v2 I get somewhat similar values, but the precision of 6 decimal places is certainly lost.
I am thinking whether it would be more appropriate to design a test as follows:
HawkesCumulantMatching
on the simulated timestamps.adjacency
with exact L1 norms.I agree that makes more sense. But I find it hard to suggest something big when I had been lazy before 😬
Hi @PhilipDeegan , Do you think we can merge this?
@PhilipDeegan I believe that this PR is ready to merge. Would it be possible to do it today?
This PR proposes to break the class
HawkesCumulantMatching
in a base class with the general interface, and a derived class that implements the methods of the interface using tensorflow. A second derived class that will implement the same methods with pytorch is also prototyped. Moreover, this PR tries to migrateHawkesCumulantMatching
to tensorflow v2 minimising the required changes: I usedtf.compat.v1
. Tests of the inference methodology are re-activated (no longer skipped by default).