class_docstr: Classy Dataset which produces random synthetic images with binary targets.
  
  The underlying dataset sets targets based on the channels in the image, so users can
  validate their setup by checking if they can get 100% accuracy on this dataset.
  Useful for testing since the dataset is much faster to initialize and fetch samples
  from, compared to real world datasets.
docstr: Instantiates a SyntheticImageDataset from a configuration.
  
  Args:
      config: A configuration for a SyntheticImageDataset.
          See :func:`__init__` for parameters expected in the config.
  
  Returns:
      A SyntheticImageDataset instance.
code: def from_config(
      cls, config: Dict[str, Any]
  ) -> "SyntheticImageDataset":
      """Instantiates a SyntheticImageDataset from a configuration.
  
      Args:
          config: A configuration for a SyntheticImageDataset.
              See :func:`__init__` for parameters expected in the config.
  
      Returns:
          A SyntheticImageDataset instance.
      """
      assert all(
          key in config for key in ["crop_size", "class_ratio", "seed"]
      )
      crop_size = config["crop_size"]
      class_ratio = config["class_ratio"]
      seed = config["seed"]
      (
          transform_config,
          batchsize_per_replica,
          shuffle,
          num_samples,
      ) = cls.parse_config(config)
  
      try:
          transform = build_transforms(transform_config)
      except Exception:
          logging.error(
              "We recently changed transform behavior"
              " do you need to update your config?"
              " See resnet50_synthetic_image_classy_config.json"
              " as an example."
          )
          raise
  
      return cls(
          batchsize_per_replica,
          shuffle,
          transform,
          num_samples,
          crop_size,
          class_ratio,
          seed,
      )
  
file_path: ClassyVision/classy_vision/dataset/classy_synthetic_image.py
imports: import logging
  from typing import Any, Callable, Dict, List, Optional
  import torchvision.transforms
  from .None import register_dataset
  from .classy_dataset import ClassyDataset
  from .core import RandomImageBinaryClassDataset
  from .transforms import build_transforms
  from .transforms.util import build_field_transform_default_imagenet, ImagenetConstants
label_desc: Use image node_id 2 for calling the SyntheticImageDataset obj's underlying member method code with example usage: obj.from_config(cls, config) and returns: cls