Skip to content

Instantly share code, notes, and snippets.

@razhangwei
Created April 12, 2019 16:08
Show Gist options
  • Save razhangwei/72882051dbeed766f991ae0e141dc76b to your computer and use it in GitHub Desktop.
Save razhangwei/72882051dbeed766f991ae0e141dc76b to your computer and use it in GitHub Desktop.
__init__.py example #Python
from .sccs import NeuralSCCS
from .log_linear_hawkes import LogLinearHawkes, StochasticLogAdditiveHawkes
__all__ = ["NeuralSCCS", "LogLinearHawkes", "StochasticLogLinearHawkes"]
def get_model(model, **kwargs):
if model == 'N-SCCS':
model = NeuralSCCS(**kwargs)
elif model == 'MSCCS':
kwargs["mlp_config"] = {"n_output": kwargs["n_outcomes"]}
model = NeuralSCCS(**kwargs)
elif model == "LLH":
model = LogLinearHawkes(**kwargs)
elif model == "SLLH":
model = StochasticLogAdditiveHawkes(include_ddi=False, **kwargs)
elif model == "SLA^2H":
model = StochasticLogAdditiveHawkes(include_ddi=True, **kwargs)
else:
raise NotImplementedError()
return model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment