class_docstr: Calculate spectral component based on the magnitude of Fast Fourier Transform (FFT).
  
  Based on:
      Dhariwal, et al. 'Jukebox: A generative model for music.' https://arxiv.org/abs/2005.00341
  
  Args:
      spatial_dims: number of spatial dimensions.
      fft_signal_size: signal size in the transformed dimensions. See torch.fft.fftn() for more information.
      fft_norm: {``"forward"``, ``"backward"``, ``"ortho"``} Specifies the normalization mode in the fft. See
          torch.fft.fftn() for more information.
  
      reduction: {``"none"``, ``"mean"``, ``"sum"``}
          Specifies the reduction to apply to the output. Defaults to ``"mean"``.
  
          - ``"none"``: no reduction will be applied.
          - ``"mean"``: the sum of the output will be divided by the number of elements in the output.
          - ``"sum"``: the output will be summed.
class_docstr_tok: ["Calculate","spectral","component","based","on","the","magnitude","of","Fast","Fourier","Transform","(","FFT",")",".","Based","on",":","Dhariwal",",","et","al",".","'Jukebox",":","A","generative","model","for","music",".","'","https",":","\/\/arxiv.org\/abs\/2005.00341","Args",":","spatial_dims",":","number","of","spatial","dimensions",".","fft_signal_size",":","signal","size","in","the","transformed","dimensions",".","See","torch.fft.fftn","(",")","for","more","information",".","fft_norm",":","{","``","``","forward","''","``",",","``","``","backward","''","``",",","``","``","ortho","''","``","}","Specifies","the","normalization","mode","in","the","fft",".","See","torch.fft.fftn","(",")","for","more","information",".","reduction",":","{","``","``","none","''","``",",","``","``","mean","''","``",",","``","``","sum","''","``","}","Specifies","the","reduction","to","apply","to","the","output",".","Defaults","to","``","``","mean","''","``",".","-","``","``","none","''","``",":","no","reduction","will","be","applied",".","-","``","``","mean","''","``",":","the","sum","of","the","output","will","be","divided","by","the","number","of","elements","in","the","output",".","-","``","``","sum","''","``",":","the","output","will","be","summed","."]
code: def __init__(
      self,
      spatial_dims: int,
      fft_signal_size: tuple[int] | None = None,
      fft_norm: str = "ortho",
      reduction: LossReduction | str = LossReduction.MEAN,
  ) -> None:
      super().__init__(reduction=LossReduction(reduction).value)
  
      self.spatial_dims = spatial_dims
      self.fft_signal_size = fft_signal_size
      self.fft_dim = tuple(range(1, spatial_dims + 2))
      self.fft_norm = fft_norm
  
file_path: MONAI/monai/losses/spectral_loss.py
imports: from __future__ import annotations
  import torch
  import torch.nn.functional
  from torch.fft import fftn
  from torch.nn.modules.loss import _Loss
  from monai.utils import LossReduction
label_desc: Use image node_id 1 to create a new JukeboxLoss object from inherited base classes: _Loss with example: obj = JukeboxLoss(spatial_dims, fft_signal_size, fft_norm, reduction)