Exemple #1
0
 def get_trainer(self, stage: int):
     return Trainer(locator.get_config(),
                    locator.get_filesystem_provider(),
                    locator.get_acoustic_model(),
                    locator.get_evaluator(),
                    locator.get_frontend_processor(),
                    stage=stage)
def main():
    logs_path = locator.get_filesystem_provider().get_logs_dir()

    try:
        proc = subprocess.Popen(["tensorboard", "--logdir", logs_path])
        webbrowser.open("http://localhost:6006/", new=0, autoraise=True)
        proc.communicate()
    except KeyboardInterrupt:
        pass
Exemple #3
0
def main():
    status("Starting...")

    status("Arranging test experiment...")
    experiment_dir = locator.get_filesystem_provider().get_experiment_dir()
    with locator.create_isolated_scope():
        override_config()
        clone_experiment_core(experiment_dir)

        status("Running training...")
        run_training()

        status("Running inference...")
        run_inference()

    status("Reloading...")
    with locator.create_isolated_scope():
        override_config()

        status("Continuing training...")
        run_training()

    status("All right!")
Exemple #4
0
def get_wav_folder_storage(dataset_name: str) -> InMemoryStorage:
    path = locator.get_filesystem_provider().get_dataset_path(
        "r", dataset_name)
    max_length = locator.get_config().framerate
    return get_storage_from_wav_folder(path, max_length)
Exemple #5
0
def get_hdf_storage(type_letter: str, dataset_name: str) -> HdfStorage:
    path = locator.get_filesystem_provider().get_dataset_path(
        type_letter, dataset_name, ".hdf5")
    return HdfStorage(path)
Exemple #6
0
import matplotlib.pyplot as plt
import numpy as np
import vui.infrastructure.locator as locator
import vui.dataset.pipeline as pipeline
import vui.frontend.dsp as dsp

config = locator.get_config()
filesystem = locator.get_filesystem_provider()


def input_local():
    frames = dsp.read("input.wav")
    config.framerate = dsp.get_framerate("input.wav")
    config.seg_length = dsp.get_best_segment_length(config.framerate)
    config.freq_count = dsp.get_freq_count(config.seg_length)
    config.freq_res = dsp.get_freq_resolution(config.framerate,
                                              config.freq_count)
    return frames


def input() -> np.ndarray:
    storage = pipeline.get_hdf_storage('r', "s_en_SpeechCommands")
    return np.reshape(storage.fetch_subset("tree", 0, 1), [-1])


def input_bulk(n: int) -> np.ndarray:
    storage = pipeline.get_hdf_storage('r', "t_mx_Mix")
    return storage.fetch_subset("", 0, n)


def output(frames_before: np.ndarray, frames_after: np.ndarray):
Exemple #7
0
def clone_experiment_core(source_dir: str):
    filesystem = locator.get_filesystem_provider()
    filesystem.clear_experiment()
    filesystem.clone_core_modules(source_dir)