docstr: Generates a tensor of dimensionality (num_inner_loop_steps) indicating the importance of each step's target
  loss towards the optimization loss.
  
  Returns:
      A tensor to be used to compute the weighted average of the loss, useful for
      the MSL (Multi Step Loss) mechanism.
docstr_tok: ["Generates","a","tensor","of","dimensionality","(","num_inner_loop_steps",")","indicating","the","importance","of","each","step","'s","target","loss","towards","the","optimization","loss",".","Returns",":","A","tensor","to","be","used","to","compute","the","weighted","average","of","the","loss",",","useful","for","the","MSL","(","Multi","Step","Loss",")","mechanism","."]
code: def _get_per_step_loss_importance_vector(self, epoch):
      """
      Generates a tensor of dimensionality (num_inner_loop_steps) indicating the importance of each step's target
      loss towards the optimization loss.
  
      Returns:
          A tensor to be used to compute the weighted average of the loss, useful for
          the MSL (Multi Step Loss) mechanism.
      """
      loss_weights = (
          np.ones(self.num_updates_per_iter, dtype=np.float32)
          / self.num_updates_per_iter
      )
      decay_rate = (
          1.0
          / self.num_updates_per_iter
          / self.multi_step_loss_num_epochs
      )
      min_value_for_non_final_losses = 0.03 / self.num_updates_per_iter
  
      for i in range(len(loss_weights) - 1):
          curr_value = np.maximum(
              loss_weights[i] - (epoch * decay_rate),
              min_value_for_non_final_losses,
          )
          loss_weights[i] = curr_value
  
      loss_weights[-1] = 1 - np.sum(loss_weights[:-1])
  
      loss_weights = torch.from_numpy(loss_weights).to(self.device)
      return loss_weights
  
file_path: PARL/benchmark/torch/maml++/maml_algorithm.py
imports: import torch
  from torch import nn
  from torch import optim
  import torch.nn.functional
  import numpy
  import parl
label_desc: Use image node_id 6 for calling the MAML obj's underlying member method code with example usage: obj._get_per_step_loss_importance_vector(epoch) and returns: loss_weights