class_docstr: Simple regression task, based on sinusoids, as introduced in [1].
  
  Parameters
  ----------
  num_samples_per_task : int
      Number of examples per task.
  
  num_tasks : int (default: 1,000,000)
      Overall number of tasks to sample.
  
  noise_std : float, optional
      Amount of noise to include in the targets for each task. If `None`, then
      nos noise is included, and the target is a sine function of the input.
  
  transform : callable, optional
      A function/transform that takes a numpy array of size (1,) and returns a
      transformed version of the input.
  
  target_transform : callable, optional
      A function/transform that takes a numpy array of size (1,) and returns a
      transformed version of the target.
  
  dataset_transform : callable, optional
      A function/transform that takes a dataset (ie. a task), and returns a 
      transformed version of it. E.g. `torchmeta.transforms.ClassSplitter()`.
  
  Notes
  -----
  The tasks are created randomly as random sinusoid function. The amplitude
  varies within [0.1, 5.0], the phase within [0, pi], and the inputs are
  sampled uniformly in [-5.0, 5.0]. Due to the way PyTorch handles datasets,
  the number of tasks to be sampled needs to be fixed ahead of time (with
  `num_tasks`). This will typically be equal to `meta_batch_size * num_batches`.
  
  References
  ----------
  .. [1] Finn C., Abbeel P., and Levine, S. (2017). Model-Agnostic Meta-Learning
         for Fast Adaptation of Deep Networks. International Conference on
         Machine Learning (ICML) (https://arxiv.org/abs/1703.03400)
code: def __init__(
      self,
      num_samples_per_task,
      num_tasks=1000000,
      noise_std=None,
      transform=None,
      target_transform=None,
      dataset_transform=None,
  ):
      super(Sinusoid, self).__init__(
          meta_split="train",
          target_transform=target_transform,
          dataset_transform=dataset_transform,
      )
      self.num_samples_per_task = num_samples_per_task
      self.num_tasks = num_tasks
      self.noise_std = noise_std
      self.transform = transform
  
      self._input_range = np.array([-5.0, 5.0])
      self._amplitude_range = np.array([0.1, 5.0])
      self._phase_range = np.array([0, np.pi])
  
      self._amplitudes = None
      self._phases = None
  
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 Sinusoid object from inherited base classes: MetaDataset with example: obj = Sinusoid(num_samples_per_task, num_tasks, noise_std, transform, target_transform, dataset_transform)