class_docstr: Note that for now, we will still follow the Dataset format stated in
  https://github.com/fjxmlzn/DoppelGANger#dataset-format.
  
  Please notice that this module can not work alone without doppelganger_torch.
class_docstr_tok: ["Note","that","for","now",",","we","will","still","follow","the","Dataset","format","stated","in","https",":","\/\/github.com\/fjxmlzn\/DoppelGANger","#","dataset-format",".","Please","notice","that","this","module","can","not","work","alone","without","doppelganger_torch","."]
code: def __init__(
      self,
      sample_len,
      real_data,
      feature_outputs,
      attribute_outputs,
      batch_size=32,
  ):
      super().__init__()
      self.sample_len = sample_len
      self.batch_size = batch_size
  
      # load data from data_dir
      # ===================================================================================
      data_all = real_data["data_feature"]
      data_attribute = real_data["data_attribute"]
      data_gen_flag = real_data["data_gen_flag"]
      data_feature_outputs = feature_outputs
      data_attribute_outputs = attribute_outputs
      self.num_real_attribute = len(data_attribute_outputs)
      self.num_feature_dim = len(data_feature_outputs)
  
      # normalize data (use this only if you want to use additional attribute(max, min))
      # actually, no additional attribute has not been fully tested now
      # ===================================================================================
      (
          data_feature,
          data_attribute,
          data_attribute_outputs,
          real_attribute_mask,
      ) = normalize_per_sample(
          data_all,
          data_attribute,
          data_feature_outputs,
          data_attribute_outputs,
      )
  
      # add generation flag to features
      # ===================================================================================
      data_feature, data_feature_outputs = add_gen_flag(
          data_feature,
          data_gen_flag,
          data_feature_outputs,
          self.sample_len,
      )
  
      # will be used in model init
      self.data_feature_outputs = data_feature_outputs
      self.data_attribute_outputs = data_attribute_outputs
      self.real_attribute_mask = real_attribute_mask
  
      # prepare input meta data
      # ===================================================================================
      total_generate_num_sample = data_feature.shape[0]
      from bigdl.nano.utils.common import invalidInputError
  
      if data_feature.shape[1] % self.sample_len != 0:
          invalidInputError(
              False, "length must be a multiple of sample_len"
          )
      self.length = int(data_feature.shape[1] / self.sample_len)
  
      # will be used in dataset init
      self.data_feature = data_feature
      self.data_attribute = data_attribute
  
file_path: BigDL/python/chronos/src/bigdl/chronos/simulator/doppelganger/data_module.py
imports: import os
  import pickle
  import numpy
  import sys
  import torch
  from torch.utils.data import DataLoader, Dataset
  from pytorch_lightning import LightningDataModule
  from .util import add_gen_flag, normalize_per_sample, renormalize_per_sample
label_desc: Use image node_id 1 to create a new DoppelGANgerDataModule object from inherited base classes: LightningDataModule with example: obj = DoppelGANgerDataModule(sample_len, real_data, feature_outputs, attribute_outputs, batch_size)