1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-11 06:46:56 +08:00
Files
qlib/qlib/contrib/tuner/launcher.py
2020-09-22 01:43:21 +00:00

35 lines
785 B
Python

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# coding=utf-8
import argparse
import importlib
import os
import yaml
from .config import TunerConfigManager
args_parser = argparse.ArgumentParser(prog="tuner")
args_parser.add_argument(
"-c",
"--config_path",
required=True,
type=str,
help="config path indicates where to load yaml config.",
)
args = args_parser.parse_args()
TUNER_CONFIG_MANAGER = TunerConfigManager(args.config_path)
def run():
# 1. Get pipeline class.
tuner_pipeline_class = getattr(importlib.import_module(".pipeline", package="qlib.contrib.tuner"), "Pipeline")
# 2. Init tuner pipeline.
tuner_pipeline = tuner_pipeline_class(TUNER_CONFIG_MANAGER)
# 3. Begin to tune
tuner_pipeline.run()