class_docstr: Apply some functions to the mini-batch
  
  Examples:
      >>> kwargs = {"process": [{"type": "fbank",
      ...                        "n_mels": 80,
      ...                        "fs": 16000},
      ...                       {"type": "cmvn",
      ...                        "stats": "data/train/cmvn.ark",
      ...                        "norm_vars": True},
      ...                       {"type": "delta", "window": 2, "order": 2}]}
      >>> transform = Transformation(kwargs)
      >>> bs = 10
      >>> xs = [np.random.randn(100, 80).astype(np.float32)
      ...       for _ in range(bs)]
      >>> xs = transform(xs)
class_docstr_tok: ["Apply","some","functions","to","the","mini-batch","Examples",":",">",">",">","kwargs","=","{","``","process","''",":","[","{","``","type","''",":","``","fbank","''",",","...","``","n_mels","''",":","80",",","...","``","fs","''",":","16000","}",",","...","{","``","type","''",":","``","cmvn","''",",","...","``","stats","''",":","``","data\/train\/cmvn.ark","''",",","...","``","norm_vars","''",":","True","}",",","...","{","``","type","''",":","``","delta","''",",","``","window","''",":","2",",","``","order","''",":","2","}","]","}",">",">",">","transform","=","Transformation","(","kwargs",")",">",">",">","bs","=","10",">",">",">","xs","=","[","np.random.randn","(","100",",","80",")",".astype","(","np.float32",")","...","for","_","in","range","(","bs",")","]",">",">",">","xs","=","transform","(","xs",")"]
code: def __init__(self, conffile=None):
      if conffile is not None:
          if isinstance(conffile, dict):
              self.conf = copy.deepcopy(conffile)
          else:
              with io.open(conffile, encoding="utf-8") as f:
                  self.conf = yaml.safe_load(f)
                  assert isinstance(self.conf, dict), type(self.conf)
      else:
          self.conf = {"mode": "sequential", "process": []}
  
      self.functions = OrderedDict()
      if self.conf.get("mode", "sequential") == "sequential":
          for idx, process in enumerate(self.conf["process"]):
              assert isinstance(process, dict), type(process)
              opts = dict(process)
              process_type = opts.pop("type")
              class_obj = dynamic_import(process_type, import_alias)
              # TODO(karita): assert issubclass(class_obj, TransformInterface)
              try:
                  self.functions[idx] = class_obj(**opts)
              except TypeError:
                  try:
                      signa = signature(class_obj)
                  except ValueError:
                      # Some function, e.g. built-in function, are failed
                      pass
                  else:
                      logging.error(
                          "Expected signature: {}({})".format(
                              class_obj.__name__, signa
                          )
                      )
                  raise
      else:
          raise NotImplementedError(
              "Not supporting mode={}".format(self.conf["mode"])
          )
  
file_path: espnet/espnet/transform/transformation.py
imports: import copy
  import io
  import logging
  from collections import OrderedDict
  from collections.abc import Sequence
  from inspect import signature
  import yaml
  from espnet.utils.dynamic_import import dynamic_import
label_desc: Use image node_id 1 to create a new Transformation object from inherited base classes: object with example: obj = Transformation(conffile)