code: def get_base_gen_cf_initialization(
      data_interface,
      encoded_size,
      cont_minx,
      cont_maxx,
      margin,
      validity_reg,
      epochs,
      wm1,
      wm2,
      wm3,
      learning_rate,
  ):
      # Dice Imports - TODO: keep this method for VAE as a spearate module or move it to feasible_base_vae.py.
      #                      Check dependencies.
      from torch import optim
  
      from dice_ml.utils.sample_architecture.vae_model import CF_VAE
  
      # Dataset for training Variational Encoder Decoder model for CF Generation
      df = data_interface.normalize_data(
          data_interface.one_hot_encoded_data
      )
      encoded_data = df[
          data_interface.ohe_encoded_feature_names
          + [data_interface.outcome_name]
      ]
      dataset = encoded_data.to_numpy()
      print("Dataset Shape:", encoded_data.shape)
      print("Datasets Columns:", encoded_data.columns)
  
      # Normalise_Weights
      normalise_weights = {}
      for idx in range(len(cont_minx)):
          _max = cont_maxx[idx]
          _min = cont_minx[idx]
          normalise_weights[idx] = [_min, _max]
  
      # Train, Val, Test Splits
      np.random.shuffle(dataset)
      test_fraction = 0.2
      # TODO: create an input parameter for data interface
      test_size = int(test_fraction * len(data_interface.data_df))
      vae_test_dataset = dataset[:test_size]
      dataset = dataset[test_size:]
      vae_val_dataset = dataset[:test_size]
      vae_train_dataset = dataset[test_size:]
  
      # BaseGenCF Model
      cf_vae = CF_VAE(data_interface, encoded_size)
  
      # Optimizer
      cf_vae_optimizer = optim.Adam(
          [
              {
                  "params": filter(
                      lambda p: p.requires_grad,
                      cf_vae.encoder_mean.parameters(),
                  ),
                  "weight_decay": wm1,
              },
              {
                  "params": filter(
                      lambda p: p.requires_grad,
                      cf_vae.encoder_var.parameters(),
                  ),
                  "weight_decay": wm2,
              },
              {
                  "params": filter(
                      lambda p: p.requires_grad,
                      cf_vae.decoder_mean.parameters(),
                  ),
                  "weight_decay": wm3,
              },
          ],
          lr=learning_rate,
      )
  
      # Check: If base_obj was passsed via reference and it mutable; might not need to have a return value at all
      return (
          vae_train_dataset,
          vae_val_dataset,
          vae_test_dataset,
          normalise_weights,
          cf_vae,
          cf_vae_optimizer,
      )
  
imports: import os
  import pickle
  import shutil
  import zipfile
  from urllib.request import urlretrieve
  import numpy
  import pandas
  from sklearn.compose import ColumnTransformer
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.model_selection import train_test_split
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import FunctionTransformer, OneHotEncoder
  import dice_ml
label_desc: Use image node_id 18 for calling a global function with example usage: get_base_gen_cf_initialization(data_interface, encoded_size, cont_minx, cont_maxx, margin, validity_reg, epochs, wm1, wm2, wm3, learning_rate) and returns: vae_train_dataset,  vae_val_dataset,  vae_test_dataset,  normalise_weights,  cf_vae,  cf_vae_optimizer