105 Commits

Author SHA1 Message Date
yqzhishen 4dc07b5892 Fix len(None) 2025-06-26 11:58:09 +08:00
yqzhishen 47ef54a2ba Enhance error message on unrecognized phones 2025-05-03 22:56:25 +08:00
yqzhishen 895dece2c2 Add loguru for logging 2025-05-03 02:46:39 +08:00
yqzhishen 15a00d06e6 Adapt variance model training to v3 (#255)
* Add variance model training

* Clean up
2025-05-02 22:25:48 +08:00
yqzhishen 9f86135c3c Basic training framework and acoustic model training (#254)
* Refactor some binarizer modules

* Training framework

* Acoustic model training

* Restore config values

* Disable `shuffle_batches`

* Support saving weights only

* Fix metric candidates

* Support console color and wrap empty objects

* Support specifying log dir

* `dask.compute` everything at once to improve perf

* Support nested schedulers

* Support auto resuming from latest checkpoint

* Remove some default values

* Check for weights_only

* Support more flexible optimizer settings

* Fix stuck in DDP (probably)

* Use default monitor candidates

* Support `ReduceLROnPlateau` scheduler

* Require sync with validation for ReduceLROnPlateau

* Print metrics

* Add suggestion to change coverage check option

* Support fine-tuning and parameter freezing

* Move registries

* Edit message

* Fix high memory usage and epoch syncing

* Add `build_xxx_dataset` methods

* Simplify augmentation index

* Fix typo: compact -> compat

* Add rank in file pattern to avoid conflict

* `torch.load` with weights_only=True

* Change to rank_zero_info

* sync_dist=True

* Fix `rank_zero_only.rank` needs to be set before use

* Try to optimize message

* Try to optimize message

* Try to optimize message

* Fix config check failure

* Fix overlapping points on TensorBoard when accumulate_grad_batches > 1

* Support EMA (experimental)

* Rename file

* Rename embedding

* Add comments and type hints

* Clean up and re-organize code

* Rename file

* Rename `used` to `enabled`

* Remove redundant wrapper method

* Fix voicing extraction

* Add augmentation flag and check

* Update tensorboard logging
2025-05-02 16:16:19 +08:00
yqzhishen 240750ba4d Adjust distribution plots 2025-04-25 20:35:26 +08:00
yqzhishen 0772d045ad Replace mel2x with explicit frame duration 2025-04-25 20:35:08 +08:00
yqzhishen f4a603fec0 Add checks for empty sequences 2025-04-25 20:11:17 +08:00
yqzhishen 1ec2510240 Refactor distribution summary printing 2025-04-25 17:02:54 +08:00
yqzhishen df1658d26d Support coverage check options 2025-04-25 16:25:45 +08:00
yqzhishen 23e5055d37 Rename package 2025-04-24 23:54:12 +08:00
yqzhishen 2ef6666ff2 Finish most part of acoustic and variance modules (#252)
* Finish acoustic and variance modules

* Fix embedding and linear imports

* Clean and re-organize modules

* Remove old file

* Remove old file
2025-04-24 23:44:08 +08:00
yqzhishen b144e06336 Binarizers with delayed computation graph (#251)
* Re-organize feature extraction packages

* Acoustic dataset binarizer

* Fix f0 interp and cyclic imports, rename classes

* Add variance config schema

* Variance dataset binarizer

* Add all-rest note check

* Extract methods

* Sort metadata by estimated duration

* Clean codes and modules

* Add checks for train_items and valid_items

* Rename files

* Duration binarizer (prototype)

* Rename file
2025-04-24 02:45:47 +08:00
yqzhishen 44ce312264 Full implementation of multi-dictionary support (#238)
* Add multi-dictionary preprocessing and training

* Fix lang_map.json copy

* Add language embed (inject to txt_embed) for acoustic models

* Save language sequence in variance preprocessing

* Display merged phoneme groups properly in distribution plots

* Add multi-dictionary inference

* Save original phoneme texts for duration plots

* Fix duration plots displaying bug

* Explicit `languages` argument passing

* Add language embed (inject to txt_embed) for variance models

* Fix argument passing

* Add log for lang_map.json copy

* Add language embedding scale

* Add language embedding type

* Preprocessing: only apply lang embed on cross-lingual phonemes

* Inference: only apply lang embed on cross-lingual phonemes

* Revert "Add language embedding type"

This reverts commit 655e9ba9611861793297956e79ccbf329313d7f2.

* Revert lang_embed_scale

* Adapt ONNX exporters for multi-language models

* Refactor configuration schemas for datasets

* Add check of existence for merged phonemes

* Fix spk_id assignment

* Fix languages.json filename

* Fix `languages` key in dsconfig.yaml

* Set `use_lang_id` to false if there are no cross-lingual phonemes

* Support defining extra phonemes

* Refactor configs

* Prefer file copies in work_dir when loading dictionaries

* Fix cannot locate dictionary

* Fix unexpected loading error when dictionary changes

* Update toplevel.py (#219)

* Fix unexpected config passing

* Update lynxnet backbone (#228)

* Change the injection method of conditions on lynxnet (#225)

* update configurations for new-lynxnet

* update configurations for new-lynxnet

* update configurations for new-lynxnet

---------

Co-authored-by: KakaruHayate <97896816+KakaruHayate@users.noreply.github.com>

* Improve fastspeech2 encoder using Rotary Position Embedding (RoPE) in multi-head self-attention (#234)

* update multi-head self attention with RoPE

* RoPE onnx (#230)

* fix requirements.txt (#233)

* fix rope for melody encoder

* support swiglu activation for ffn

* update dependencies

---------

Co-authored-by: KakaruHayate <97896816+KakaruHayate@users.noreply.github.com>

* support mini-nsf-hifigan vocoder

* discard negative pad

* fix MHA inference using low torch version

* Fix missing phoneme list sorting

* Fix single-language dictionary parsing language tag

* Add `pitch_controllable` flag to vocoder exporter

(cherry picked from commit a6deb6b5c3)

* support noise injection

* Allow merging global phonemes and language-specific phonemes

* Check for conflicts between short names and global tags

* Finish documentation for multi-dictionary

---------

Co-authored-by: Anjo <87346264+AnAndroNerd@users.noreply.github.com>
Co-authored-by: yxlllc <33565655+yxlllc@users.noreply.github.com>
Co-authored-by: KakaruHayate <97896816+KakaruHayate@users.noreply.github.com>
Co-authored-by: yxlllc <llc1995@sina.com>
2025-03-29 22:19:59 +08:00
yqzhishen 5e58109f48 Make note_glide optional 2024-09-13 21:41:33 +08:00
yqzhishen b9e69703df Add checks for negative note duration 2024-07-13 22:58:44 +08:00
yqzhishen a1c0a5ff26 Apply 2nd stage of mel base migration plan 2024-07-12 23:31:15 +08:00
yqzhishen 01223d0010 Add checks for negative phoneme duration 2024-07-01 13:24:29 +08:00
yqzhishen 4fcd7154d6 Add checks for negative phoneme duration 2024-07-01 02:37:51 +08:00
yxlllc f4a6e95e7e Using VR model to estimate variance parameters (#196)
* add vr separator

* apply no_grad

* apply global model

* Refactor code

* Enhance model

* fix an alignment bug in tension extractor

* fix an alignment bug in tension extractor

* Add documentation for VR

* Adjust configs

---------

Co-authored-by: yqzhishen <yangqian_1015@icloud.com>
2024-06-19 23:59:52 +08:00
yqzhishen 28563a1279 Support using e as the base number of the log mel-spectrogram (#175)
* Add `mel_base` and set `e` as default value

* Export dynamic `mel_base`

* Restore old configs

* Refactor mel extraction

* add mel-base check for ddsp vocoder

---------

Co-authored-by: yxlllc <llc1995@sina.com>
2024-03-04 22:39:36 +08:00
yqzhishen c16095bc55 Drop support for some old features and behaviors (#172)
* Drop support for discrete F0 embedding (reserved in ONNX exporter)

* Drop support for `interp_uv` configuration key

* Drop support for `train_set_name` and `valid_set_name` configuration keys

* Drop support for linear domain of random time stretching augmentation

* Drop support for `num_pad_tokens` configuration key

* Drop support for code backup before training

* Drop support for `ffn_padding` configuration key

* Drop support for random seeding

* Add placeholder to load old checkpoint

* Remove duplicate txt_embed layer (resuming may raise errors)

* Remove migration script and error message for transcriptions.txt

* Remove seed from batch shuffling

* Use direct access on some hparam keys

* Fix duplicate keys in YAML

* Rename `pndm_speedup` to `diff_speedup`
2024-02-25 20:57:02 +08:00
yqzhishen e5c79c0c20 New variance parameter: voicing (#170)
* Support voicing in acoustic and variance models (experimental)

* Fix KeyError
2024-02-24 01:17:42 +08:00
yqzhishen b8ba29975a New variance parameter: tension (#169)
* Add `DeconstructedWaveform` class and base harmonic extraction algorithm (by yxlllc)

* Support tension in acoustic and variance models (experimental)

* Support Kth harmonic extraction

* Use square difference instead

* Support weighted multi-harmonic definition

* Unify all tension domains in one function

* Remove `hparams` from pitch extraction APIs

* Fix KeyError
2024-02-19 20:53:52 +08:00
Dachun Sun 36ac5f583b Multi-node batched validation and improvement on strategy selection (#148)
* More metadata when binarize

* Picklable AttrDict

* Support other notion of 'sizes'

* Better strategy getter, Ds TB logger, and eval batch sampler.

* Add title to plots and specify figsize

* Unify batch sampler and bug fixes

* Batch and multi-device validation

* Fix imports

* Fix deadlock under multigpu and resume from ckpt

* Remove unnecessary if in base_dataset

* Move build loss to finish init and ft to build model

* Prevent repeated valid item

* Remove optimizer_idx to support lightning 2.1

* Warning message fix

* Fix val error when aux is off

* Rename fields in metadata and add doc

* Adjust respective duration logging for each speaker

* val persisent worker, module list ordering, update doc

---------

Co-authored-by: yqzhishen <yangqian_1015@icloud.com>
2023-10-29 00:37:14 +08:00
yqzhishen 3ae0e7db53 Implement melody encoder and support glide input (#143)
* Add melody encoder and support glide notes

* Support melody encoder inference

* Add note visualization on TensorBoard

* Remove base pitch embedding when using melody encoder

* Fix KeyError `use_glide_embed`

* Fix invalid access to NoneType

* Support melody encoder ONNX export

* Fix KeyError `use_melody_encoder`

* Support note glide ONNX export

* Support custom glide types

* Support glide embedding scale

* Adjust glide type format

* Remove unnecessary interpolation on frame-level MIDI pitch

* Add glide type coverage checks
2023-10-08 23:24:17 +08:00
yqzhishen 054567a8d8 Fix wrong spk_id assignment in fixed pitch shifting augmentation 2023-08-20 14:21:57 +08:00
yqzhishen 78ae36d9d3 Support training variance models from DS files (#132)
* Support training variance model with DS files

* Prefer full name matching

* Fix attribute error

* Fix NoneType error

* Add error message if attribute is missing

* Trim ds segment index suffix

* Skip parameter smoothing if loading from DS file
2023-08-11 11:50:22 +08:00
yqzhishen f3dd1ecccb Add support for objective evaluation metrics (#123)
* Support objective evaluation metrics

* Add raw pitch accuracy (RPA) logging

* Exclude unvoiced and padding frames
2023-07-30 14:40:12 +08:00
yqzhishen b1304f8164 Fix OOM when turning on augmentation 2023-07-27 00:39:15 +08:00
yqzhishen 7b3c2adf83 Invert wrong logical expr 2023-07-22 14:27:50 +08:00
yqzhishen 75abeae6b5 Fix augmentation error when multiprocessing 2023-07-21 18:02:55 +08:00
yqzhishen f74046db31 Support custom pitch extractor (#118)
* Support custom pitch extractor

* Add doc for `pe` and `pe_ckpt`
2023-07-19 23:57:38 +08:00
yqzhishen cd26ecb143 Add MIDI distribution summary to variance binarizer 2023-07-14 23:29:18 +08:00
yqzhishen 9fcfd2efb1 Add phoneme coverage checks to variance binarizer 2023-07-14 22:49:26 +08:00
yqzhishen 801e05eddf Adjust comments 2023-07-05 23:58:25 +08:00
yqzhishen 21de5a111b Fix missing mel2ph when not training duration predictor 2023-07-03 22:37:37 +08:00
yqzhishen c2e0027b2c Fix conflict of item name when merging speakers 2023-06-28 23:51:55 +08:00
yqzhishen 65b4be379b Modify param names and docs for ds_id and spk_id 2023-06-24 02:36:49 +08:00
yqzhishen 224fd33f39 Support custom spk_id arrangements 2023-06-24 02:20:51 +08:00
yqzhishen 830ee8459e Modification of energy and breathiness definitions (#91)
* Change energy and breathiness definition to dB

* Smoothen energy and breathiness

* Smoothen energy and breathiness (acoustic model)

* Update comments

* Support different values of `dilation_cycle_length`

* Add missing `torch.no_grad()`
2023-05-29 22:58:45 +08:00
yqzhishen 109f56558c Fix base_pitch is all zero when using multiprocessing binarizer on Windows 2023-05-26 16:05:09 +08:00
yqzhishen c8ac07d750 Support variance embeds in acoustic exporter 2023-05-26 00:55:55 +08:00
yqzhishen eb161aa905 Make some attributes optional in binarizer according to requirements 2023-05-25 19:32:55 +08:00
yqzhishen b4dcafa554 Merge branch 'refactor-v2' into variance 2023-05-18 20:09:23 +08:00
yqzhishen c29e073d02 Fix label format to CSV and add migrating scripts 2023-05-18 18:28:22 +08:00
yqzhishen 8c2b7350de Merge branch 'refactor-v2' into variance 2023-05-17 20:38:33 +08:00
yqzhishen 4b0d95ad65 Use direct indexing on augmentation args 2023-05-13 21:30:00 +08:00
yqzhishen 34fe5399ff Augmentations can now be disabled with enabled config keys 2023-05-13 21:17:36 +08:00
ms903x1 cec7760005 Freeze transcriptions generation format to CSV and deprecate meta.json (#85)
* Update acoustic_binarizer.py

add "os.path.exists(path)" to determine whether to read "transcriptions.csv" or "transcriptions.txt".

* Update acoustic_binarizer.py

Delete Meta.json related code.
Use pathlib API replacement of os.path.

* 更新notebook

删除生成txt版transcriptions文件相关代码,删除meta.json相关代码。

* fix

多删了个换行,修复一下
2023-05-09 23:36:17 +08:00