mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-15 08:46:56 +08:00
use init_instance_by_config
This commit is contained in:
committed by
you-n-g
parent
93796bdcef
commit
8c743a46c7
@@ -49,6 +49,7 @@ def begin_task_train(task_config: dict, experiment_name: str, recorder_name: str
|
|||||||
def fill_placeholder(config: dict, config_extend: dict):
|
def fill_placeholder(config: dict, config_extend: dict):
|
||||||
"""
|
"""
|
||||||
Detect placeholder in config and fill them with config_extend.
|
Detect placeholder in config and fill them with config_extend.
|
||||||
|
The item of dict must be single item(int, str, etc), dict and list. Tuples are not supported.
|
||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
----------
|
----------
|
||||||
@@ -116,9 +117,7 @@ def end_task_train(rec: Recorder, experiment_name: str) -> Recorder:
|
|||||||
if isinstance(records, dict): # prevent only one dict
|
if isinstance(records, dict): # prevent only one dict
|
||||||
records = [records]
|
records = [records]
|
||||||
for record in records:
|
for record in records:
|
||||||
cls, kwargs = get_cls_kwargs(record, default_module="qlib.workflow.record_temp")
|
r = init_instance_by_config(record, recorder = rec)
|
||||||
kwargs["recorder"] = rec
|
|
||||||
r = cls(**kwargs)
|
|
||||||
r.generate()
|
r.generate()
|
||||||
return rec
|
return rec
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user