def add(filenames, output): for f in filenames: try: inputs.append(load_vector(f, vectorizer)) outputs.append(np.array([output])) except ValueError: print('Skipping invalid file:', f)
def loader(kws: list, nkws: list): from precise.params import pr inputs = np.empty((0, pr.n_features, pr.feature_size)) outputs = np.zeros((len(kws), 1)) for f in kws: if not isfile(f): continue new_vec = load_vector(f, vectorize_inhibit) inputs = np.concatenate([inputs, new_vec]) return self.merge((inputs, outputs), self.__load_files(kws, nkws))
def add(filenames, output): for i, f in enumerate(filenames): try: inputs.append(load_vector(f, vectorizer)) outputs.append(np.array([output])) except InvalidAudio as e: print('Skipping invalid file:', f, e) print('\r{0:.2%} '.format(i / len(filenames)), end='', flush=True) print('\r \r', end='', flush=True)