Ejemplo n.º 1
0
                         get_vad=2,
                         get_qspec=True,
                         pitch_threshold=0.8,
                         cqt_bins=96,
                         vad_smooth=3,
                         vad_minlen=0.1,
                         pca=True,
                         pca_whiten=False,
                         center=True,
                         save_stats=True,
                         substitute_nan=None,
                         dtype='float16',
                         datatype='memmap',
                         ncache=0.12,
                         ncpu=8)
with utils.UnitTimer():
    feat.run()
shutil.copy(os.path.join(datapath, 'README.md'),
            os.path.join(output_path, 'README.md'))
# ====== check the preprocessed dataset ====== #
ds = F.Dataset(output_path, read_only=True)
print('Output path:', output_path)
print(ds)

for n in ds.keys():
    if '_pca' in n:
        pca = ds[n]
        if pca.components_ is None:
            print(n, 'components is None !')
        elif np.any(np.isnan(pca.components_)):
            print(n, 'contains NaN !')
Ejemplo n.º 2
0
import numba as nb

from odin import utils

X = np.random.rand(50000, 123)


def normal(x):
    idx = list(range(0, x.shape[0], 5))
    _ = [x[i:i + 21].ravel() for i in idx if (i + 21) <= x.shape[0]]
    x = np.asarray(_) if len(_) > 1 else _[0]
    # np.random.shuffle(x)
    return x


with utils.UnitTimer(12):
    for i in range(12):
        x1 = normal(X)
print(x1.shape)

tmp = np.ones((20000, 2583))


@nb.jit('f8[:,:](f8[:,:], f8[:,:])',
        locals={},
        nopython=True,
        nogil=True,
        cache=True)
def fast(x, tmp):
    idx = list(range(0, x.shape[0], 5))
    count = 0