Example #1
0
def train_env() -> ContextManager[TrainEnv]:
    hyperparameters = {
        "context_length": context_length,
        "prediction_length": prediction_length,
        "num_samples": num_samples,
    }
    with testutil.temporary_train_env(hyperparameters, "constant") as env:
        yield env
Example #2
0
def train_env(listify_dataset) -> ContextManager[TrainEnv]:
    hyperparameters = {
        "context_length": context_length,
        "prediction_length": prediction_length,
        "num_samples": num_samples,
        "listify_dataset": listify_dataset,
        "num_workers": 3,
        "num_prefetch": 4,
        "shuffle_buffer_length": 256,
        "epochs": 3,
    }
    with testutil.temporary_train_env(hyperparameters, "constant") as env:
        yield env