base_config:
  - configs/base.yaml

task_cls: training.variance_task.VarianceTask

dictionaries: {}
extra_phonemes: []
merged_phoneme_groups: []
datasets: []

audio_sample_rate: 44100
hop_size: 512            # Hop size.
fft_size: 2048           # FFT size.
win_size: 2048           # FFT size.
midi_smooth_width: 0.06  # in seconds

binarization_args:
  shuffle: true
  num_workers: 0
  prefer_ds: false

binary_data_dir: 'data/opencpop_variance/binary'
binarizer_cls: preprocessing.variance_binarizer.VarianceBinarizer

use_lang_id: false
num_lang: 1
use_spk_id: false
num_spk: 1

predict_dur: true
predict_pitch: true
predict_energy: false
predict_breathiness: false
predict_voicing: false
predict_tension: false

enc_ffn_kernel_size: 3
use_rope: true
rope_interleaved: false
use_stretch_embed: false
use_variance_scaling: true
rel_pos: true
hidden_size: 384

dur_prediction_args:
  arch: resnet
  hidden_size: 256
  dropout: 0.1
  num_layers: 5
  kernel_size: 3
  log_offset: 1.0
  loss_type: mse
  lambda_pdur_loss: 0.3
  lambda_wdur_loss: 1.0
  lambda_sdur_loss: 3.0

use_melody_encoder: true
melody_encoder_args:
  hidden_size: 128
  enc_layers: 4
use_glide_embed: false
glide_types: [up, down]
glide_embed_scale: 11.313708498984760  # sqrt(128)

pitch_prediction_args:
  pitd_norm_min: -8.0
  pitd_norm_max: 8.0
  pitd_clip_min: -12.0
  pitd_clip_max: 12.0
  repeat_bins: 64
  backbone_type: 'lynxnet2'
  backbone_args:
    num_layers: 6
    num_channels: 512
    dropout_rate: 0.0
    use_conditioner_cache: true
    glu_type: 'atanglu'

energy_db_min: -96.0
energy_db_max: -12.0
energy_smooth_width: 0.06

breathiness_db_min: -96.0
breathiness_db_max: -20.0
breathiness_smooth_width: 0.06
voicing_db_min: -96.0
voicing_db_max: -12.0
voicing_smooth_width: 0.06

tension_logit_min: -10.0
tension_logit_max: 10.0
tension_smooth_width: 0.06

variances_prediction_args:
  total_repeat_bins: 72
  backbone_type: 'lynxnet2'
  backbone_args:
    num_layers: 6
    num_channels: 384
    dropout_rate: 0.0
    use_conditioner_cache: true
    glu_type: 'atanglu'

lambda_dur_loss: 1.0
lambda_pitch_loss: 1.0
lambda_var_loss: 1.0

diffusion_type: reflow  # ddpm
time_scale_factor: 1000
schedule_type: 'linear'
K_step: 1000
timesteps: 1000
max_beta: 0.02
main_loss_type: l2
main_loss_log_norm: true
sampling_algorithm: euler
sampling_steps: 20
diff_accelerator: ddim
diff_speedup: 10

# train and eval
num_sanity_val_steps: 1
optimizer_args:
  optimizer_cls: modules.optimizer.muon.Muon_AdamW
  lr: 0.0006
  muon_args:
    weight_decay: 0.1
  adamw_args:
    weight_decay: 0.0
lr_scheduler_args:
  step_size: 5000
  gamma: 0.8
max_batch_frames: 80000
max_batch_size: 48
dataset_size_key: 'lengths'
val_check_interval: 4000
num_valid_plots: 10
max_updates: 80000
num_ckpt_keep: 5
permanent_ckpt_start: 30000
permanent_ckpt_interval: 10000

finetune_enabled: false
finetune_ckpt_path: null
finetune_ignored_params:
  - model.spk_embed
  - model.fs2.txt_embed
  - model.fs2.encoder.embed_tokens
finetune_strict_shapes: true

freezing_enabled: false
frozen_params: []
