| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Great Job @lucadellalib! I did a quick code inspection and shared some comments about the docstrings.
Other Comments:
Sorry, something went wrong.
|
|
||
|
|
||
| class Generation(sb.Brain): | ||
| def fit_batch(self, batch): |
There was a problem hiding this comment.
For every method, we typically add some short description about its functionality for better clarity (See for instance this). It is even more important here as some methods are not standard.
Sorry, something went wrong.
| return super()._fit_valid(valid_set, epoch, enable) | ||
|
|
||
| @torch.no_grad() | ||
| def evaluate_batch(self, batch, stage): |
There was a problem hiding this comment.
Make sure every method has a short description.
Sorry, something went wrong.
|
|
||
|
|
||
| def prepare_recipe(hparams, run_opts): | ||
| # Dataset preparation |
There was a problem hiding this comment.
Add docstring
Sorry, something went wrong.
| audio_backend="soundfile", | ||
| **kwargs, | ||
| ): | ||
| """This function prepares the datasets to be used in the brain class. |
There was a problem hiding this comment.
Improve the docstring by explaining all the parameters. They are a lot in this case, but that can improve clarity and usability.
Sorry, something went wrong.
| provides = ["sig"] | ||
|
|
||
| def audio_pipeline_train(wav): | ||
| original_sample_rate = sb.dataio.dataio.read_audio_info(wav).sample_rate |
There was a problem hiding this comment.
Make sure all the functions have a short docstring
Sorry, something went wrong.
|
|
||
|
|
||
| class DWER(MetricStats): | ||
| def __init__( |
There was a problem hiding this comment.
Add docstring with a working example
Sorry, something went wrong.
|
|
||
|
|
||
| class SpkSimWavLM(MetricStats): | ||
| def __init__( |
There was a problem hiding this comment.
Add a docstring with a working example (such that we can test all with our doc tests)
Sorry, something went wrong.
|
|
||
|
|
||
| class UTMOS(MetricStats): | ||
| def __init__(self, sample_rate, model=None): |
There was a problem hiding this comment.
Add docstring with example
Sorry, something went wrong.
|
|
||
|
|
||
| class HingeGLoss(nn.Module): | ||
| """Hinge Generator Loss |
There was a problem hiding this comment.
Add the example to the docstring
Sorry, something went wrong.
|
|
||
|
|
||
| class HingeDLoss(nn.Module): | ||
| """Hinge Discriminator Loss |
There was a problem hiding this comment.
Add example
Sorry, something went wrong.
I think this PR follows the policy: for recipes, the only requirement is an extra-requirements.txt file with all non-speechbrain dependencies. The one thing I might suggest is adding transformers to the extra requirements, as this is (mostly) moved to integrations now, not a core dependency.
Perhaps we can leave it here for now, and move it if we do end up using it for other recipes. The principle of YAGNI (you ain't gonna need it) might apply here, let's keep it as straightforward as possible and not plan too far ahead. |
Sorry, something went wrong.
|
Thank you for your comments @pplantinga! Do you have other comments or suggestions? |
Sorry, something went wrong.
|
@Adel-Moumen, do you also have some comments and suggestions here? |
Sorry, something went wrong.
|
I tested the recipe and the recipe tests. All seems to work properly.
|
Sorry, something went wrong.
|
This PR LGTM now. I think we can go ahead and merge it, unless @pplantinga or @Adel-Moumen have further comments. Great Job @lucadellalib! |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Add FocalCodec training recipe.