예제 #1
0
파일: trainer.py 프로젝트: ycl010203/qlib
def begin_task_train(task_config: dict,
                     experiment_name: str,
                     recorder_name: str = None) -> Recorder:
    """
    Begin task training to start a recorder and save the task config.

    Args:
        task_config (dict): the config of a task
        experiment_name (str): the name of experiment
        recorder_name (str): the given name will be the recorder name. None for using rid.

    Returns:
        Recorder: the model recorder
    """
    with R.start(experiment_name=experiment_name, recorder_name=recorder_name):
        R.log_params(**flatten_dict(task_config))
        R.save_objects(**{"task": task_config
                          })  # keep the original format and datatype
        R.set_tags(**{"hostname": socket.gethostname()})
        recorder: Recorder = R.get_recorder()
    return recorder
예제 #2
0
파일: trainer.py 프로젝트: you-n-g/qlib
def _log_task_info(task_config: dict):
    R.log_params(**flatten_dict(task_config))
    R.save_objects(**{"task":
                      task_config})  # keep the original format and datatype
    R.set_tags(**{"hostname": socket.gethostname()})