Comments (6)
Yes, this is fine if you only care about MAE/MSE + accuracy. You could simply use the context
tensor to obtain the (point estimate of the) next inter-event time and train using the objective function that you specified. The code will look something like
features = self.get_features(batch)
context = self.get_context(features)
m = F.softplus(self.linear_time(context))
mae = torch.abs(m - batch.inter_times).sum(-1)
Then you could train this model using the objective function that you wrote above (I assume the absolute value is missing in the first term after =
).
You can interpret this as a TPP model where the conditional distribution over the inter-event times has density p(tau) ∝ exp(-|tau - m|)
. Note that this is not the Laplace distribution with mean m
: Laplace distribution is supported on (-\infty, \infty)
, but this inter-event time distribution is supported on [0, infty)
. This distribution doesn't have a name, I don't know how to compute its density and I it's probably impossible to sample from it. However, if you only care about MAE/MSE + accuracy, this shouldn't be a problem. What we have here is rather a truncated Laplace distribution.
If, however, you compute MAE as mae = (torch.abs(m - batch.inter_times) / batch.inter_times).sum(-1)
, then I'm quite sure that this doesn't have an interpretation as a conditional density. You can still train your model with this loss just like before though, if you don't care about other things like sampling.
from ifl-tpp.
Thank you for your reply! It helped me a lot.
Why exactly p(tau) ∝ exp(-|tau - m|)
? Can I interpret this also as an TPP with p(tau) ∝ exp(-(tau - m)^2)
. So to say, a "Gaussian" distribution on [0, infinity)?
from ifl-tpp.
Yes, your statement about p(tau) ∝ exp(-(tau - m)^2)
is correct. Btw, here is a Wikipedia page about such truncated distributions https://en.wikipedia.org/wiki/Truncated_distribution.
I will also provide some context here. A TPP is a generative model for variable-length continuous-time event sequences. We usually train such models by maximizing the log-likelihood of the training sequences. You can interpret some losses, such as MAE or MSE, as the negative log-likelihood of some TPP model where the conditional distribution p*(tau) over the inter-event times has a special form. However, it doesn't mean that only losses that have this interpretation are "valid". In fact, if you only care about a point estimate of the next inter-event times (as measured by MAE/MSE) or of the accuracy of mark prediction, you don't even need a TPP model–you can directly optimize the loss that you care about. You should only worry about the "probabilistic" interpretation if you want to draw samples from the trained generative model.
Put differently, I don't quite understand why MAE/MSE is used to evaluate TPPs. TPPs proposed in the literature usually define the entire distribution over the inter-event times, but MAE/MSE only care about a point estimate. I can totally imagine cases where MAE/MSE are useful metrics, but I don't think we should use TPPs in such scenarios–a simpler model that only produces a point estimate instead of the entire distribution will probably do much better.
from ifl-tpp.
Thank you for the link to the Wikipedia page.
Yes, I agree with you that if one just need the point estimate, a TPP is not necessary. For my application I tried both approaches for computing the point estimate - with and without TPP. Calculating the point estimate from the context vector without TPP worked better.
from ifl-tpp.
Related Issues (20)
- LogNorm curiosity HOT 4
- Code for using context vector in the models HOT 2
- on log likelihood misunderstanding HOT 4
- history HOT 5
- Hyperparameters for reproducibility HOT 6
- Sampling points of a specific mark HOT 3
- Implementation on missing data imputation HOT 1
- Understanding given datasets HOT 5
- NLL results HOT 5
- Sampling with additional conditional information
- use other dataset HOT 1
- Missing data imputation HOT 1
- Calculate the mean of the entire distribution. HOT 7
- all evaluation expriments code HOT 1
- Calculate the mean of the entire distribution. HOT 23
- How could I get the predicted results? HOT 20
- ATM dataset testing HOT 2
- Learning with Marks HOT 9
- How to get the expression of the distribution of inter-event time HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ifl-tpp.