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

Hawkes Cumulant Matching - PyTorch implementation #506

Draft
wants to merge 32 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2e981d9
Hawkes cumulant matching - Disable tf v2
claudio-ICL Dec 9, 2022
6a664fe
Merge branch 'master' into pytorch-hawkes-cumulant
claudio-ICL Dec 11, 2022
b54c69e
HawkesCumulantMatchinmgPyT
claudio-ICL Dec 11, 2022
05be509
Pytorch loss function
claudio-ICL Dec 12, 2022
f232c58
Hawkes cumulant - pytorch solver
claudio-ICL Dec 13, 2022
541a829
Tensorflow - Run tests from Thinkpad
claudio-ICL Dec 13, 2022
3b53061
Hawkes cumulant tests - formatting
claudio-ICL Dec 14, 2022
f7b17ea
Hawkes cumulants - Tensorflow v1
claudio-ICL Dec 14, 2022
e9ce6dd
Merge branch 'master' into tensorflow-v1-hawkes-cumulants
claudio-ICL Dec 14, 2022
8b3ca40
Hawkes Cumulant Test - tf and torch
claudio-ICL Dec 14, 2022
f550245
Hawkes Cumulant - Pytorch implementation
claudio-ICL Dec 14, 2022
6d6b943
Install tensorflow-cpu
claudio-ICL Dec 14, 2022
bee8a54
Hawkes Cumulant - theoretical quantities & testing
claudio-ICL Dec 16, 2022
55e8a2a
Use unitest.skipIf when tf not available
claudio-ICL Dec 19, 2022
6af2bef
Tests from tensorflow-v1-hawkes-cumulants
claudio-ICL Dec 19, 2022
b6508f3
Merge branch 'tensorflow-v1-hawkes-cumulants' into
claudio-ICL Dec 19, 2022
480a0b0
remove merge messages
claudio-ICL Dec 19, 2022
76aafa7
New tests
claudio-ICL Dec 19, 2022
449fa52
HawkesCumulant - Add test of relative magnitudes
claudio-tw Jan 24, 2023
31e03d9
Merge branch 'tensorflow-v1-hawkes-cumulants' into pytorch-hawkes-cum…
claudio-tw Jan 24, 2023
205b4f8
HawkesCumulant pytorch - l1 and l2 penalisations
claudio-tw Jan 24, 2023
a8c9e63
HawkesCumulant - convert R start to tensor
claudio-tw Jan 26, 2023
aced3c2
HawkesCumulant - test objective and starting point
claudio-tw Jan 27, 2023
11353f4
HawkesTheoreticalCumulantr - rename cumulants
claudio-tw Feb 2, 2023
fa43f6d
HawkesTheoreticalCumulant - const specifier in setters
claudio-tw Feb 2, 2023
37844c3
Merge 'master' into tensorflow-v1-hawkes-cumulants
claudio-tw Feb 2, 2023
837331e
HawkesCumulantMatching - Use new tensorflow class in example
claudio-tw Feb 2, 2023
9cc6090
Test Hawkes Cumulants - loging
claudio-ICL Feb 14, 2023
1181645
Merge #505 into #506
claudio-ICL Feb 14, 2023
17531e3
HawkesCumulant - PyT print history
claudio-ICL Feb 14, 2023
5e1d29d
Merge branch 'master' into pytorch-hawkes-cumulant
claudio-ICL Mar 5, 2023
91ee97c
Use either TF or torch in the example script
claudio-ICL Mar 5, 2023
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
17 changes: 12 additions & 5 deletions examples/plot_hawkes_cumulants_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,25 @@
.. _In International Conference on Machine Learning (pp. 1-10): http://proceedings.mlr.press/v70/achab17a.html
"""

skip = True
skip = False
try:
import tensorflow
skip = False
from tick.hawkes import HawkesCumulantMatchingTf as HawCuMa
print("Using tensorflow.")
except ImportError:
print("tensorflow not found, skipping HawkesCumulantMatching")
print("tensorflow not found, looking for pytorch instead")
import torch
from tick.hawkes import HawkesCumulantMatchingPyT as HawCuMa
print("Using pytorch.")
except ImportError:
print("Neither tensorflow nor torch found, skipping HawkesCumulantMatching")
skip = True

if not skip:

import numpy as np

from tick.hawkes import (HawkesCumulantMatchingTf, SimuHawkesExpKernels,
from tick.hawkes import (SimuHawkesExpKernels,
SimuHawkesMulti)
from tick.plot import plot_hawkes_kernel_norms

Expand Down Expand Up @@ -58,7 +65,7 @@
n_threads=-1)
multi.simulate()

nphc = HawkesCumulantMatchingTf(integration_support, cs_ratio=.15, tol=1e-10,
nphc = HawCuMa(integration_support, cs_ratio=.15, tol=1e-10,
step=0.3)

nphc.fit(multi.timestamps)
Expand Down
Loading