class_docstr: Simple multimodal regression task, based on sinusoids and lines, 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 either a sine function, or a
      linear 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 either random sinusoid functions, or
  random linear functions. The amplitude of the sinusoids varies within
  [0.1, 5.0] and the phase within [0, pi]. The slope and intercept of the lines
  vary in [-3.0, 3.0]. 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., Xu K., Levine S. (2018). Probabilistic Model-Agnostic
         Meta-Learning. In Advances in Neural Information Processing Systems
         (https://arxiv.org/abs/1806.02817)
class_docstr_tok: ["Simple","multimodal","regression","task",",","based","on","sinusoids","and","lines",",","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","either","a","sine","function",",","or","a","linear","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","either","random","sinusoid","functions",",","or","random","linear","functions",".","The","amplitude","of","the","sinusoids","varies","within","[","0.1",",","5.0","]","and","the","phase","within","[","0",",","pi","]",".","The","slope","and","intercept","of","the","lines","vary","in","[","-3.0",",","3.0","]",".","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.",",","Xu","K.",",","Levine","S.","(","2018",")",".","Probabilistic","Model-Agnostic","Meta-Learning",".","In","Advances","in","Neural","Information","Processing","Systems","(","https",":","\/\/arxiv.org\/abs\/1806.02817",")"]
code: def is_sinusoid(self):
      if self._is_sinusoid is None:
          self._is_sinusoid = np.zeros(
              (self.num_tasks,), dtype=np.bool_
          )
          self._is_sinusoid[self.num_tasks // 2 :] = True
          self.np_random.shuffle(self._is_sinusoid)
      return self._is_sinusoid
  
file_path: pytorch-meta/torchmeta/toy/sinusoid_line.py
imports: import numpy
  from torchmeta.utils.data import Task, MetaDataset
  from torchmeta.toy.sinusoid import SinusoidTask
label_desc: Use image node_id 6 for calling the SinusoidAndLine obj's underlying member method code with example usage: obj.is_sinusoid() and returns: self