Пример #1
0
from data.data_tools import read_metadata, males_keys, females_keys
from data.dataset import Mixer
from models.adapt import Adapt
from models.dpcl import DPCL
from utils.tools import getETA
import time
import numpy as np
import tensorflow as tf
import config
import os

H5_dic = read_metadata()
chunk_size = 512*40

males = H5PY_RW('test_raw.h5py', subset = males_keys(H5_dic))
fem = H5PY_RW('test_raw.h5py', subset = females_keys(H5_dic))

print 'Data with', len(H5_dic), 'male and female speakers'
print males.length(), 'elements'
print fem.length(), 'elements'

mixed_data = Mixer([males, fem], chunk_size= chunk_size, with_mask=False, with_inputs=True)


####
#### PREVIOUS MODEL CONFIG
####

N = 256
max_pool = 256
batch_size = 32
Пример #2
0
import config
import numpy as np
import tensorflow as tf

if __name__ == "__main__":
    H5_dico = read_data_header()

    Males = H5PY_RW()
    Males.open_h5_dataset('test.h5py', subset=males_keys(H5_dico))
    Males.set_chunk(config.chunk_size)
    Males.shuffle()
    print 'Male voices loaded: ', Males.length(), ' items'

    Females = H5PY_RW()
    Females.open_h5_dataset('test.h5py', subset=females_keys(H5_dico))
    Females.set_chunk(config.chunk_size)
    Females.shuffle()
    print 'Female voices loaded: ', Females.length(), ' items'

    Mixer = Mixer([Males, Females])

    das_model = DAS(S=len(Mixer.get_labels()), T=config.chunk_size)

    das_model.init()

    for i in range(100):
        print 'Step #', i
        X, Y, Ind = Mixer.get_batch(64)
        x_mixture = []
Пример #3
0
import sys
import tensorflow as tf
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
# Get your datasets

from data.dataset import H5PY_RW
from data.data_tools import read_metadata, males_keys, females_keys

file = 'test_raw_16k.h5py'
H5_dic = read_metadata()
chunk_size = 512 * 10

males = H5PY_RW(file,
                subset=males_keys(H5_dic)).set_chunk(chunk_size).shuffle()
fem = H5PY_RW(file,
              subset=females_keys(H5_dic)).set_chunk(chunk_size).shuffle()
print 'Data with', len(H5_dic), 'male and female speakers'

# Mixing the dataset

from data.dataset import Mixer

mixed_data = Mixer([males, fem], with_mask=False, with_inputs=True)

# Training set selection
mixed_data.select_split(0)

# Model pretrained loading

N = 256
max_pool = 128