code: def gen_sparse_config(
      args,
      sparse_lr,
      init_range,
      op_type,
      emb_size,
      feature_lr,
      nodeid_slot,
      load_filter_slots,
      sparse_table_class,
  ):
      """
      gen sparse config
      """
      sparse_config = dict()
      sparse_config["sparse_table_class"] = sparse_table_class
      sparse_config["sparse_compress_in_save"] = True
      sparse_config["sparse_shard_num"] = 67
      # sparse_config['sparse_accessor_class'] = "DownpourCtrAccessor"
      sparse_config[
          "sparse_accessor_class"
      ] = "DownpourCtrDymfAccessor"  # for variable embedding
      sparse_config["sparse_learning_rate"] = sparse_lr
      sparse_config["sparse_initial_g2sum"] = 3
      sparse_config["sparse_initial_range"] = init_range
      sparse_config["sparse_weight_bounds"] = [-10.0, 10.0]
      sparse_config["sparse_embedx_dim"] = emb_size
      sparse_config["sparse_embedx_threshold"] = 0
      sparse_config["sparse_nonclk_coeff"] = 0.1
      sparse_config["sparse_click_coeff"] = 1.0
      sparse_config["sparse_base_threshold"] = 0
      sparse_config["sparse_delta_threshold"] = 0.25
      sparse_config["sparse_delta_keep_days"] = 16.0
      sparse_config["sparse_show_click_decay_rate"] = 0.98
      sparse_config["sparse_delete_threshold"] = 0.8
      sparse_config["sparse_delete_after_unseen_days"] = 30
  
      sparse_config["embed_sparse_optimizer"] = op_type
      sparse_config["embed_sparse_learning_rate"] = sparse_lr
      sparse_config["embed_sparse_initial_range"] = 0
      sparse_config[
          "embed_sparse_beta1_decay_rate"
      ] = 0.9  # args.beta1_decay_rate
      sparse_config[
          "embed_sparse_beta2_decay_rate"
      ] = 0.999  # args.beta2_decay_rate
      sparse_config["embed_sparse_weight_bounds"] = [-10.0, 10.0]
  
      sparse_config["embedx_sparse_optimizer"] = op_type
      sparse_config["embedx_sparse_learning_rate"] = sparse_lr
      sparse_config["embedx_sparse_initial_range"] = init_range
      sparse_config[
          "embedx_sparse_beta1_decay_rate"
      ] = 0.9  # args.beta1_decay_rate
      sparse_config[
          "embedx_sparse_beta2_decay_rate"
      ] = 0.999  # args.beta2_decay_rate
      sparse_config["embedx_sparse_weight_bounds"] = [-10.0, 10.0]
      sparse_config["nodeid_slot"] = nodeid_slot
      sparse_config["feature_learning_rate"] = feature_lr
      sparse_config["sparse_load_filter_slots"] = load_filter_slots
      return sparse_config
  
file_path: PGL/apps/PGLBox/src/config_fleet.py
imports: import os
  import copy
  import numpy
  import paddle
  from pgl.utils.logger import log
label_desc: Use image node_id 2 for calling a global function with example usage: gen_sparse_config(args, sparse_lr, init_range, op_type, emb_size, feature_lr, nodeid_slot, load_filter_slots, sparse_table_class) and returns: sparse_config