Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Adding loss operator of a Hawkes self-exciting process #14683

Merged
merged 1 commit into from
May 20, 2019

Conversation

canerturkmen
Copy link
Contributor

Description

The Hawkes process is a temporal point process model for self-exciting phenomena such as earthquakes, limit orders (finance), neuronal stimuli and social media activity.

This operator computes the log likelihood of a set of "marked" Hawkes processes, whose observations are represented in variable length (ragged) tensors.

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http:https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

@canerturkmen
Copy link
Contributor Author

@szha @eric-haibin-lin

@nswamy nswamy added Operator pr-awaiting-review PR is waiting for code review labels Apr 15, 2019
src/operator/contrib/hawkes_ll-inl.h Outdated Show resolved Hide resolved
src/operator/contrib/hawkes_ll-inl.h Outdated Show resolved Hide resolved
@eric-haibin-lin
Copy link
Member

Thanks for the contribution! I have not done reading all code yet, just one quick comment

@roywei
Copy link
Member

roywei commented Apr 29, 2019

@canerturkmen Thanks for the contribution, could you take a look at the test failure?

@canerturkmen
Copy link
Contributor Author

@canerturkmen Thanks for the contribution, could you take a look at the test failure?

Thanks for the comment @roywei. I understand it was an unrelated random fail of another op's test.

@canerturkmen
Copy link
Contributor Author

@eric-haibin-lin thanks for your comment Haibin! I think this version should do it (with more verbose indexing of the inputs and outputs).

@canerturkmen
Copy link
Contributor Author

I believe the test fail is unrelated to the contribution (for commit hash a47a7f0)

FAIL: test_random_size_crop (test_image.TestImage)

----------------------------------------------------------------------

Traceback (most recent call last):

  File "/work/mxnet/tests/python/unittest/common.py", line 177, in test_new

    orig_test(*args, **kwargs)

  File "/work/mxnet/tests/python/unittest/test_image.py", line 368, in test_random_size_crop

    assert ratio[0] <= float(new_w)/new_h <= ratio[1]

AssertionError: 

-------------------- >> begin captured logging << --------------------

common: INFO: Setting test np/mx/python random seeds, use MXNET_TEST_SEED=869412463 to reproduce.

--------------------- >> end captured logging << ---------------------

@eric-haibin-lin
Copy link
Member

Thanks for the update. I triggered the CI again and hopefully it passes this time. Are you going to contribute an end2end example for point process model? Or do you have a link to an example for point process?

@canerturkmen
Copy link
Contributor Author

Thanks @eric-haibin-lin! The model will be part of a separate library which will use the operator.

@canerturkmen
Copy link
Contributor Author

Apologies for a careless mistake in CONTRIBUTORS.

As far as the example goes, this is rather a "likelihood" that can be reused in point process models, but the operator itself can be used directly to compute the density of a simple Hawkes process model. There's a link in the doc string to a tutorial. I can update with a link later when the model itself is open-sourced (WIP).

@canerturkmen
Copy link
Contributor Author

The test fail is not related to the operator.

@eric-haibin-lin
Copy link
Member

Triggered the test again. This test seems to be disabled on mxnet master. If it does not pass this time, we need to sync with the master branch

@canerturkmen
Copy link
Contributor Author

Looks like it's another unrelated test fail this time. Anyway, I synced with the latest master. Fingers crossed.

======================================================================
FAIL: Run LeNet-5 inference comparison between MXNet and TensorRT.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/work/mxnet/tests/python/tensorrt/test_tensorrt_lenet5.py", line 100, in test_tensorrt_inference
    MXNet = %f, TensorRT = %f""" % (mx_pct, trt_pct)
AssertionError: Diff. between MXNet & TensorRT accuracy too high:
           MXNet = 99.130000, TensorRT = 99.140000

@eric-haibin-lin eric-haibin-lin merged commit 720aa29 into apache:master May 20, 2019
@eric-haibin-lin
Copy link
Member

Thanks for your contribution! Look forward to your model when it is open sourced

haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Operator pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants