code: def __init__(
      self,
      index,
      amplitude,
      phase,
      input_range,
      noise_std,
      num_samples,
      transform=None,
      target_transform=None,
      np_random=None,
  ):
      super(SinusoidTask, self).__init__(index, None)  # Regression task
      self.amplitude = amplitude
      self.phase = phase
      self.input_range = input_range
      self.num_samples = num_samples
      self.noise_std = noise_std
  
      self.transform = transform
      self.target_transform = target_transform
  
      if np_random is None:
          np_random = np.random.RandomState(None)
  
      self._inputs = np_random.uniform(
          input_range[0], input_range[1], size=(num_samples, 1)
      )
      self._targets = amplitude * np.sin(self._inputs - phase)
      if (noise_std is not None) and (noise_std > 0.0):
          self._targets += noise_std * np_random.randn(num_samples, 1)
  
file_path: pytorch-meta/torchmeta/toy/sinusoid.py
imports: import numpy
  from torchmeta.utils.data import Task, MetaDataset
label_desc: Use image node_id 1 to create a new SinusoidTask object from inherited base classes: Task with example: obj = SinusoidTask(index, amplitude, phase, input_range, noise_std, num_samples, transform, target_transform, np_random)