docstr: Regularization of AR coefficients
  
  Parameters
  ----------
      weights : torch.Tensor
          Model weights to be regularized towards zero
      original : bool
          Do not penalize non-zeros
  
  Returns
  -------
      numeric
          Regularization loss
code: def regularize(self, weights, original=False):
      """Regularization of AR coefficients
  
      Parameters
      ----------
          weights : torch.Tensor
              Model weights to be regularized towards zero
          original : bool
              Do not penalize non-zeros
  
      Returns
      -------
          numeric
              Regularization loss
      """
  
      if original:
          reg = (
              torch.div(
                  2.0,
                  1.0
                  + torch.exp(
                      -2 * (1e-9 + torch.abs(weights)).pow(1 / 2.0)
                  ),
              )
              - 1.0
          )
      else:
          reg = utils_torch.penalize_nonzero(
              weights, eagerness=3, acceptance=1.0
          )
      return reg
  
imports: from __future__ import annotations
  import logging
  import math
  import types
  from collections import OrderedDict
  from dataclasses import dataclass, field
  from typing import Callable, List, Optional
  from typing import OrderedDict
  from typing import Type, Union
  import numpy
  import pandas
  import torch
  from neuralprophet import df_utils, np_types, utils, utils_torch
  from neuralprophet.custom_loss_metrics import PinballLoss
label_desc: Use image node_id 2 for calling the AR obj's underlying member method code with example usage: obj.regularize(weights, original) and returns: reg