Blocks that compose the `Model`.

Miscellaneous

class RandomWalk(nn.Module):
    def __init__(self, n, breaks):
        super().__init__()
        self.w = nn.Parameter(torch.randn(n,1))
        self.breaks = breaks
        
    def forward(self, x):
        w = F.softplus(self.w.cumsum(0))
        x_sec = get_section(x, self.breaks)
        return w[x_sec]

class DefaultModel[source]

DefaultModel(moments, breakpoints=None, y_n=7, m_n=5, w_n=0, l=None, h=None) :: Module

Sum of Linear Trend, Seasonality and squashed.

class DefaultQModel[source]

DefaultQModel(moments, breakpoints=None, y_n=7, m_n=5, w_n=0, l=None, h=None, quantiles=[0.05, 0.5, 0.95]) :: Module

Same as DefaultModel but with multiple outputs corresponding to quantiles