woshiyyya / ERPP-RMTPP

A pytorch implementation of ERPP and RMTPP on ATM maintenance dataset.
55 stars 21 forks source link

Predicted Time calculation #4

Open SZH1230456 opened 4 years ago

SZH1230456 commented 4 years ago

Hi, I am confused with the predicted time calculation in Equation (13) as follows: image I see it in the code, you just replace the predicted time with v^{t}.h_j, could you please illustrate it in detail?

mohit2agrawal commented 4 years ago

The paper mentions that it uses certain "numerical integration techniques" to solve for 13. But, I could not find that in the official implementation (C++) at https://github.com/dunan/NeuralPointProcess.

@SZH1230456 Were you able to figure out something?

Kaimaoge commented 4 years ago
def next_time(self,tj,hj):
    umax = self.umax #maximum time
    Deltat = umax/self.N
    dt = torch.linspace(0, umax, self.N+1)
    df = dt * self.fstart(dt, hj)
    #normalization factor
    integrand_ = ((df[1:] + df[:-1]) * 0.5) * Deltat
    integral_ = torch.sum(integrand_)
    return tj + integral_

This is the numerical method

mohit2agrawal commented 4 years ago

Thanks @Kaimaoge . I see that tf_rmtpp uses scipy.integrate.quad method.

liyuxisummer commented 3 years ago
def next_time(self,tj,hj):
    umax = self.umax #maximum time
    Deltat = umax/self.N
    dt = torch.linspace(0, umax, self.N+1)
    df = dt * self.fstart(dt, hj)
    #normalization factor
    integrand_ = ((df[1:] + df[:-1]) * 0.5) * Deltat
    integral_ = torch.sum(integrand_)
    return tj + integral_

This is the numerical method

@Kaimaoge Hi, I‘m confused with the function of self.umax, self.N and self.fstart, could you please explain it?

Kaimaoge commented 3 years ago
def next_time(self,tj,hj):
    umax = self.umax #maximum time
    Deltat = umax/self.N
    dt = torch.linspace(0, umax, self.N+1)
    df = dt * self.fstart(dt, hj)
    #normalization factor
    integrand_ = ((df[1:] + df[:-1]) * 0.5) * Deltat
    integral_ = torch.sum(integrand_)
    return tj + integral_

This is the numerical method

@Kaimaoge Hi, I‘m confused with the function of self.umax, self.N and self.fstart, could you please explain it?

umax is the upper limits of integration, N here is the number of units for calculating numerical integration, f_stat is the probability function.

liyuxisummer commented 3 years ago
def next_time(self,tj,hj):
    umax = self.umax #maximum time
    Deltat = umax/self.N
    dt = torch.linspace(0, umax, self.N+1)
    df = dt * self.fstart(dt, hj)
    #normalization factor
    integrand_ = ((df[1:] + df[:-1]) * 0.5) * Deltat
    integral_ = torch.sum(integrand_)
    return tj + integral_

This is the numerical method

@Kaimaoge Hi, I‘m confused with the function of self.umax, self.N and self.fstart, could you please explain it?

umax is the upper limits of integration, N here is the number of units for calculating numerical integration, f_stat is the probability function.

@Kaimaoge Thanks, could you please share the code of fstart you used?

waystogetthere commented 3 years ago

Thanks @Kaimaoge . I see that tf_rmtpp uses scipy.integrate.quad method.

Always this method reports warning:

IntegrationWarning: The occurrence of roundoff error is detected, which prevents the requested tolerance from being achieved. The error may be underestimated.

And the f_star always encounters exp() overflow. Also I am wondering the way they calculate the lambda: https://github.com/musically-ut/tf_rmtpp/blob/master/src/tf_rmtpp/rmtpp_core.py#L621 it is a little different from the paper

zhzfight commented 1 year ago
def next_time(self,tj,hj):
    umax = self.umax #maximum time
    Deltat = umax/self.N
    dt = torch.linspace(0, umax, self.N+1)
    df = dt * self.fstart(dt, hj)
    #normalization factor
    integrand_ = ((df[1:] + df[:-1]) * 0.5) * Deltat
    integral_ = torch.sum(integrand_)
    return tj + integral_

This is the numerical method

@Kaimaoge Hi, I‘m confused with the function of self.umax, self.N and self.fstart, could you please explain it?

umax is the upper limits of integration, N here is the number of units for calculating numerical integration, f_stat is the probability function. hello, i use f_start to predict next time, but the rmse is too big, Have you ever tried this way?