ref: 57f255d00e178d2689a6606e847943299932f828
parent: 27213ebf285ecb2187a57acedbd4f5d741afd225
author: Tristan Matthews <tmatth@videolan.org>
date: Fri Nov 8 06:26:38 EST 2024
dnn: fix spelling Signed-off-by: Jean-Marc Valin <jeanmarcv@google.com>
--- a/dnn/kiss99.h
+++ b/dnn/kiss99.h
@@ -29,7 +29,7 @@
/*KISS PRNG from George Marsaglia (1999 version).
See https://en.wikipedia.org/wiki/KISS_(algorithm) for details.
- This is suitable for simulations, but not for use in crytographic contexts.*/
+ This is suitable for simulations, but not for use in cryptographic contexts.*/
typedef struct kiss99_ctx kiss99_ctx;
--- a/dnn/torch/dnntools/dnntools/relegance/meta_critic.py
+++ b/dnn/torch/dnntools/dnntools/relegance/meta_critic.py
@@ -35,7 +35,7 @@
Args:
gamma (float, optional): update rate for tracking discriminator stats. Defaults to 0.9.
- beta (float, optional): Miminum confidence related threshold. Defaults to 0.0.
+ beta (float, optional): Minimum confidence related threshold. Defaults to 0.0.
"""
self.normalize = normalize
self.gamma = gamma
@@ -82,4 +82,4 @@
if False: print(f"relevance({disc_id}): {relevance.min()=} {relevance.max()=} {relevance.mean()=}")
- return relevance
\ No newline at end of file
+ return relevance
--- a/dnn/torch/dnntools/dnntools/relegance/relegance.py
+++ b/dnn/torch/dnntools/dnntools/relegance/relegance.py
@@ -75,7 +75,7 @@
""" creates a partition kernel for mapping a convolutional network output back to the input domain
Given a fully convolutional network with receptive field of shape widths and the given strides, this
- function construncts an intorpolation kernel whose tranlations by multiples of the given strides form
+ function constructs an interpolation kernel whose translations by multiples of the given strides form
a partition of one on the input domain.
Parameter:
@@ -446,4 +446,4 @@
else:
raise ValueError(f'[relegance_map_to_input_domain] error: num_dims = {num_dims} not supported')
- return resized_relevance
\ No newline at end of file
+ return resized_relevance
--- a/dnn/torch/fargan/adv_train_fargan.py
+++ b/dnn/torch/fargan/adv_train_fargan.py
@@ -54,7 +54,7 @@
training_group.add_argument('--lr-decay', type=float, help='learning rate decay factor, default: 0.0', default=0.0)
training_group.add_argument('--initial-checkpoint', type=str, help='initial checkpoint to start training from, default: None', default=None)
training_group.add_argument('--reg-weight', type=float, help='regression loss weight, default: 1.0', default=1.0)
-training_group.add_argument('--fmap-weight', type=float, help='feature matchin loss weight, default: 1.0', default=1.)
+training_group.add_argument('--fmap-weight', type=float, help='feature matching loss weight, default: 1.0', default=1.)
args = parser.parse_args()
--- a/dnn/torch/fargan/stft_loss.py
+++ b/dnn/torch/fargan/stft_loss.py
@@ -33,7 +33,7 @@
"""Spectral convergence loss module."""
def __init__(self):
- """Initilize spectral convergence loss module."""
+ """Initialize spectral convergence loss module."""
super(SpectralConvergenceLoss, self).__init__()
def forward(self, x_mag, y_mag):
@@ -52,7 +52,7 @@
"""Log STFT magnitude loss module."""
def __init__(self):
- """Initilize los STFT magnitude loss module."""
+ """Initialize los STFT magnitude loss module."""
super(LogSTFTMagnitudeLoss, self).__init__()
def forward(self, x, y):
--- a/dnn/torch/fwgan/models/fwgan500.py
+++ b/dnn/torch/fwgan/models/fwgan500.py
@@ -236,7 +236,7 @@
def forward(self, pitch_period, bfcc_with_corr, x0):
- #This should create a latent representation of shape [Batch_dim, 500 frames, 256 elemets per frame]
+ #This should create a latent representation of shape [Batch_dim, 500 frames, 256 elements per frame]
p_embed = self.create_phase_signals(pitch_period).permute(0, 2, 1).contiguous()
envelope = self.bfcc_with_corr_upsampler(bfcc_with_corr.permute(0,2,1).contiguous())
feat_in = torch.cat((p_embed , envelope), dim=1)
--- a/dnn/torch/lpcnet/make_test_config.py
+++ b/dnn/torch/lpcnet/make_test_config.py
@@ -36,7 +36,7 @@
parser.add_argument("test_name", type=str, help="name for test result display")
parser.add_argument("checkpoint", type=str, help="checkpoint to test")
parser.add_argument("--lpcnet-demo", type=str, help="path to lpcnet_demo binary, default: /local/code/LPCNet/lpcnet_demo", default="/local/code/LPCNet/lpcnet_demo")
-parser.add_argument("--lpcnext-path", type=str, help="path to lpcnext folder, defalut: dirname(__file__)", default=os.path.dirname(__file__))
+parser.add_argument("--lpcnext-path", type=str, help="path to lpcnext folder, default: dirname(__file__)", default=os.path.dirname(__file__))
parser.add_argument("--python-exe", type=str, help='python executable path, default: sys.executable', default=sys.executable)
parser.add_argument("--pad", type=str, help="left pad of output in seconds, default: 0.015", default="0.015")
parser.add_argument("--trim", type=str, help="left trim of output in seconds, default: 0", default="0")
--- a/dnn/torch/neural-pitch/evaluation.py
+++ b/dnn/torch/neural-pitch/evaluation.py
@@ -3,7 +3,7 @@
Procedure:
- Look at all voiced frames in file
- Compute number of pitches in those frames that lie within a 50 cent threshold
- RPA = (Total number of pitches within threshold summed across all files)/(Total number of voiced frames summed accross all files)
+ RPA = (Total number of pitches within threshold summed across all files)/(Total number of voiced frames summed across all files)
"""
import os
--- a/dnn/torch/neural-pitch/training.py
+++ b/dnn/torch/neural-pitch/training.py
@@ -33,7 +33,7 @@
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu_index)
-# Fixing the seeds for reproducability
+# Fixing the seeds for reproducibility
import time
np_seed = int(time.time())
torch_seed = int(time.time())
--- a/dnn/torch/neural-pitch/utils.py
+++ b/dnn/torch/neural-pitch/utils.py
@@ -36,7 +36,7 @@
"""
Take as input the (N * 256) xcorr features output by LPCNet and perform the following
1. Downsample and Upsample by 2 (followed by smoothing)
- 2. Append positional embeddings (of dim k) coresponding to each xcorr lag
+ 2. Append positional embeddings (of dim k) corresponding to each xcorr lag
"""
from scipy.signal import resample_poly, lfilter
--- a/dnn/torch/osce/stndrd/evaluation/moc.py
+++ b/dnn/torch/osce/stndrd/evaluation/moc.py
@@ -172,7 +172,7 @@
fs2, y = wavfile.read(args.deg)
if max(fs1, fs2) != 16000:
- raise ValueError('error: encountered sampling frequency diffrent from 16kHz')
+ raise ValueError('error: encountered sampling frequency different from 16kHz')
x = x.astype(np.float32) / 2**15
y = y.astype(np.float32) / 2**15
--- a/dnn/torch/osce/stndrd/evaluation/moc2.py
+++ b/dnn/torch/osce/stndrd/evaluation/moc2.py
@@ -180,7 +180,7 @@
fs2, y = wavfile.read(args.deg)
if max(fs1, fs2) != 16000:
- raise ValueError('error: encountered sampling frequency diffrent from 16kHz')
+ raise ValueError('error: encountered sampling frequency different from 16kHz')
x = x.astype(np.float32) / 2**15
y = y.astype(np.float32) / 2**15
--- a/dnn/torch/osce/stndrd/evaluation/run_osce_test.py
+++ b/dnn/torch/osce/stndrd/evaluation/run_osce_test.py
@@ -188,7 +188,7 @@
print(f"{num_passed}/{len(clips)} tests passed!")
- print(f"worst case occured at clip {worst_clip} with relative difference of {min_rel_diff}")
+ print(f"worst case occurred at clip {worst_clip} with relative difference of {min_rel_diff}")
print(f"worst mean relative difference was {min_mean} for test {worst_lang}")
np.save(os.path.join(outputdir, f'results_' + "_".join(test_options) + f"_{bitrate}.npy"), results, allow_pickle=True)
--- a/dnn/torch/osce/utils/moc.py
+++ b/dnn/torch/osce/utils/moc.py
@@ -143,7 +143,7 @@
fs2, y = wavfile.read(args.deg)
if max(fs1, fs2) != 16000:
- raise ValueError('error: encountered sampling frequency diffrent from 16kHz')
+ raise ValueError('error: encountered sampling frequency different from 16kHz')
x = x.astype(np.float32) / 2**15
y = y.astype(np.float32) / 2**15
--- a/dnn/torch/rdovae/import_rdovae_weights.py
+++ b/dnn/torch/rdovae/import_rdovae_weights.py
@@ -44,7 +44,7 @@
model_group.add_argument('--latent-dim', type=int, help="number of symbols produces by encoder, default: 80", default=80)
model_group.add_argument('--cond-size', type=int, help="first conditioning size, default: 256", default=256)
model_group.add_argument('--cond-size2', type=int, help="second conditioning size, default: 256", default=256)
-model_group.add_argument('--state-dim', type=int, help="dimensionality of transfered state, default: 24", default=24)
+model_group.add_argument('--state-dim', type=int, help="dimensionality of transferred state, default: 24", default=24)
model_group.add_argument('--quant-levels', type=int, help="number of quantization levels, default: 40", default=40)
args = parser.parse_args()
@@ -140,4 +140,4 @@
checkpoint['state_dict'] = model.state_dict()
- torch.save(checkpoint, args.output)
\ No newline at end of file
+ torch.save(checkpoint, args.output)
--- a/dnn/torch/rdovae/rdovae/rdovae.py
+++ b/dnn/torch/rdovae/rdovae/rdovae.py
@@ -207,7 +207,7 @@
def weight_clip_factory(max_value):
- """ weight clipping function concerning sum of abs values of adjecent weights """
+ """ weight clipping function concerning sum of abs values of adjacent weights """
def clip_weight_(w):
stop = w.size(1)
# omit last column if stop is odd
@@ -604,7 +604,7 @@
chunks = []
for offset in range(stride):
- # start is the smalles number = offset mod stride that decodes to a valid range
+ # start is the smallest number = offset mod stride that decodes to a valid range
start = offset
while enc_stride * (start + 1) - dec_stride < 0:
start += stride
--- a/dnn/torch/rdovae/train_rdovae.py
+++ b/dnn/torch/rdovae/train_rdovae.py
@@ -48,7 +48,7 @@
model_group.add_argument('--latent-dim', type=int, help="number of symbols produces by encoder, default: 80", default=80)
model_group.add_argument('--cond-size', type=int, help="first conditioning size, default: 256", default=256)
model_group.add_argument('--cond-size2', type=int, help="second conditioning size, default: 256", default=256)
-model_group.add_argument('--state-dim', type=int, help="dimensionality of transfered state, default: 24", default=24)
+model_group.add_argument('--state-dim', type=int, help="dimensionality of transferred state, default: 24", default=24)
model_group.add_argument('--quant-levels', type=int, help="number of quantization levels, default: 16", default=16)
model_group.add_argument('--lambda-min', type=float, help="minimal value for rate lambda, default: 0.0002", default=2e-4)
model_group.add_argument('--lambda-max', type=float, help="maximal value for rate lambda, default: 0.0104", default=0.0104)
--- a/dnn/torch/testsuite/README.md
+++ b/dnn/torch/testsuite/README.md
@@ -9,7 +9,7 @@
pip install -r requirements.txt
```
-The test scrip run_warpq_test.py requires a setup file in yaml format, which specifies how
+The test script run_warpq_test.py requires a setup file in yaml format, which specifies how
to generate a wave file OUTPUT from a wave file INPUT sampled resampled to the specified
sampling rate as a list of shell commands. This makes it easy to test other neural vocoders
with it as well. Two examples are given in examples. INPUT and OUTPUT will be replaced by using
@@ -43,4 +43,4 @@
stats.txt contains mean values over all, the 10 best and the 10 worst items
setup.yml contains all information to repeat the run
htms contains a self-contained website displaying the 10 best and 10 worst items
-processing contains processing output
\ No newline at end of file
+processing contains processing output
--- a/dnn/torch/weight-exchange/README.md
+++ b/dnn/torch/weight-exchange/README.md
@@ -3,7 +3,7 @@
## Weight Exchange
-Repo wor exchanging weights betweeen torch an tensorflow.keras modules, using an intermediate numpy format.
+Repo wor exchanging weights between torch an tensorflow.keras modules, using an intermediate numpy format.
Routines for loading/dumping torch weights are located in exchange/torch and can be loaded with
```
@@ -18,4 +18,4 @@
## C export
-The module `exchange.c_export` contains routines to export weights to C files. On the long run it will be possible to call all `dump_...` functions with either a path string or a `CWriter` instance based on which the export format is chosen. This is currently only implemented for `torch.nn.GRU`, `torch.nn.Linear` and `torch.nn.Conv1d`.
\ No newline at end of file
+The module `exchange.c_export` contains routines to export weights to C files. On the long run it will be possible to call all `dump_...` functions with either a path string or a `CWriter` instance based on which the export format is chosen. This is currently only implemented for `torch.nn.GRU`, `torch.nn.Linear` and `torch.nn.Conv1d`.
--- a/dnn/torch/weight-exchange/wexchange/c_export/c_writer.py
+++ b/dnn/torch/weight-exchange/wexchange/c_export/c_writer.py
@@ -41,7 +41,7 @@
nnet_header="nnet.h",
add_typedef=False):
"""
- Writer class for creating souce and header files for weight exports to C
+ Writer class for creating source and header files for weight exports to C
Parameters:
-----------
@@ -178,4 +178,4 @@
try:
self.close()
except:
- pass
\ No newline at end of file
+ pass
--
⑨