class_docstr: Autoformer is the first method to achieve the series-wise connection,
  with inherent O(LlogL) complexity
class_docstr_tok: ["Autoformer","is","the","first","method","to","achieve","the","series-wise","connection",",","with","inherent","O","(","LlogL",")","complexity"]
code: def __init__(self, configs):
      super().__init__()
      kwargs = {k: getattr(configs, k) for k in configs._fields}
      self.save_hyperparameters(kwargs)
      pl.seed_everything(configs.seed, workers=True)
      self.seq_len = configs.seq_len
      self.label_len = configs.label_len
      self.pred_len = configs.pred_len
      self.output_attention = configs.output_attention
      self.optim = configs.optim
      self.lr = configs.lr
      self.lr_scheduler_milestones = configs.lr_scheduler_milestones
      self.loss = loss_creator(configs.loss)
      self.c_out = configs.c_out
  
      # Decomp
      # change kernei_size to odd
      kernel_size = int(2 * (configs.moving_avg // 2)) + 1
      self.decomp = series_decomp(kernel_size)
  
      # Embedding
      # The series-wise connection inherently contains the sequential information.
      # Thus, we can discard the position embedding of transformers.
      self.enc_embedding = DataEmbedding_wo_pos(
          configs.enc_in,
          configs.d_model,
          configs.embed,
          configs.freq,
          configs.dropout,
      )
      self.dec_embedding = DataEmbedding_wo_pos(
          configs.dec_in,
          configs.d_model,
          configs.embed,
          configs.freq,
          configs.dropout,
      )
  
      # Encoder
      self.encoder = Encoder(
          [
              EncoderLayer(
                  AutoCorrelationLayer(
                      AutoCorrelation(
                          False,
                          configs.factor,
                          attention_dropout=configs.dropout,
                          output_attention=configs.output_attention,
                      ),
                      configs.d_model,
                      configs.n_heads,
                  ),
                  configs.d_model,
                  configs.d_ff,
                  moving_avg=kernel_size,
                  dropout=configs.dropout,
                  activation=configs.activation,
              )
              for l in range(configs.e_layers)
          ],
          norm_layer=my_Layernorm(configs.d_model),
      )
      # Decoder
      self.decoder = Decoder(
          [
              DecoderLayer(
                  AutoCorrelationLayer(
                      AutoCorrelation(
                          True,
                          configs.factor,
                          attention_dropout=configs.dropout,
                          output_attention=False,
                      ),
                      configs.d_model,
                      configs.n_heads,
                  ),
                  AutoCorrelationLayer(
                      AutoCorrelation(
                          False,
                          configs.factor,
                          attention_dropout=configs.dropout,
                          output_attention=False,
                      ),
                      configs.d_model,
                      configs.n_heads,
                  ),
                  configs.d_model,
                  configs.c_out,
                  configs.d_ff,
                  moving_avg=kernel_size,
                  dropout=configs.dropout,
                  activation=configs.activation,
              )
              for l in range(configs.d_layers)
          ],
          norm_layer=my_Layernorm(configs.d_model),
          projection=nn.Linear(
              configs.d_model, configs.c_out, bias=True
          ),
      )
  
file_path: BigDL/python/chronos/src/bigdl/chronos/model/autoformer/Autoformer.py
imports: import torch
  import torch.nn
  from .layers.Embed import DataEmbedding_wo_pos
  from .layers.AutoCorrelation import AutoCorrelation, AutoCorrelationLayer
  from .layers.Autoformer_EncDec import Encoder, Decoder, EncoderLayer, DecoderLayer, my_Layernorm, series_decomp
  import torch.optim
  import pytorch_lightning
  from collections import namedtuple
  from ..utils import PYTORCH_REGRESSION_LOSS_MAP
label_desc: Use image node_id 1 to create a new AutoFormer object from inherited base classes: pl with example: obj = AutoFormer(configs)