docstr: This method overrides the method from the PiecewiseLinear class.
docstr_tok: ["This","method","overrides","the","method","from","the","PiecewiseLinear","class","."]
code: def compute_m_t(
      self,
      current_segment,
      past_next_changepoint,
      meta_name_tensor_one_hot=None,
  ):
      """This method overrides the method from the PiecewiseLinear class."""
      # Computing m_t.
      # m_t represents the value at the origin(t=0) that we would need to have so that if we use (k_t + k_0) as slope,
      # we reach the same value at time = chagepoint_start_of_segment_i
      # that the segmented slope (having in each segment the slope trend_deltas(i) + k_0)
      if self.config_trend.growth != "discontinuous":
          # Intermediate computation: deltas.
          # `deltas`` is representing the difference between trend slope in the current_segment at time t
          #  and the trend slope in the previous segment.
          if self.segmentwise_trend:
              # dimensions - quantiles, num_trends_modelled, segments
              deltas = self.trend_deltas[:, :, :] - torch.cat(
                  (self.trend_k0, self.trend_deltas[:, :, 0:-1]), dim=2
              )
  
          else:
              deltas = self.trend_deltas
  
          # dimensions - quantiles, 1, segments
          gammas = -self.trend_changepoints_t[1:] * deltas[:, :, 1:]
          # dimensions - batch_size, n_forecasts, quantiles
          m_t = torch.sum(
              past_next_changepoint.unsqueeze(dim=2)
              * gammas.permute(1, 0, 2).unsqueeze(1),
              dim=-1,
          )
  
          if not self.segmentwise_trend:
              m_t = m_t.detach()
      else:
          # For discontinuous, trend_m is a parameter to optimize, as it is not defined just
          # by trend_deltas & trend_k0
          # m_t = m_t(current_segment)
          # dimensions - batch_size, n_forecasts, quantiles
          m_t = torch.sum(
              current_segment.unsqueeze(dim=2)
              * self.trend_m.permute(1, 0, 2).unsqueeze(dim=0),
              dim=-1,
          )
  
      return m_t
  
imports: import numpy
  import torch
  import torch.nn
  from neuralprophet.components.trend import Trend
  from neuralprophet.utils_torch import init_parameter
label_desc: Use image node_id 3 for calling the GlobalPiecewiseLinearTrend obj's underlying member method code with example usage: obj.compute_m_t(current_segment, past_next_changepoint, meta_name_tensor_one_hot) and returns: m_t