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","."]
docstr: Calculate the amplitude of the fourier transformations representation of the images
  
  Args:
      images: Images that are to undergo fftn
  
  Returns:
      fourier transformation amplitude
docstr_tok: ["Calculate","the","amplitude","of","the","fourier","transformations","representation","of","the","images","Args",":","images",":","Images","that","are","to","undergo","fftn","Returns",":","fourier","transformation","amplitude"]
code: def _get_fft_amplitude(self, images: torch.Tensor) -> torch.Tensor:
      """
      Calculate the amplitude of the fourier transformations representation of the images
  
      Args:
          images: Images that are to undergo fftn
  
      Returns:
          fourier transformation amplitude
      """
      img_fft = fftn(
          images,
          s=self.fft_signal_size,
          dim=self.fft_dim,
          norm=self.fft_norm,
      )
  
      amplitude = torch.sqrt(
          torch.real(img_fft) ** 2 + torch.imag(img_fft) ** 2
      )
  
      return amplitude
  
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 3 for calling the JukeboxLoss obj's underlying member method code with example usage: obj._get_fft_amplitude(images) and returns: amplitude