Skip to content

Commit

Permalink
Revised model.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xisen-w committed Jul 10, 2024
1 parent 033529e commit ccdbed5
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions rdagent/scenarios/qlib/task_generator/model.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
from rdagent.components.coder.model_coder.model import ModelImplementation
from rdagent.core.task_generator import TaskGenerator


class QlibModelImplementation(TaskGenerator[ModelImplementation]):
# FBTaskImpl...
class QlibModelTaskImpl(ModelTaskImpl):
"""
Docker run
Everything in a folder
- config.yaml
- Pytorch `model.py`
- results in `mlflow`
https://github.com/microsoft/qlib/blob/main/qlib/contrib/model/pytorch_nn.py
- pt_model_uri: hard-code `model.py:Net` in the config
- let LLM modify model.py
Docker-based Qlib image
code should be implementd in a folder,
Then the folder should be mounted into a Qlib docker image
# This is Mr Xiao's work???
"""

def __init__(self, **kwargs):
self.kwargs = kwargs

# def prepare(self):
# pass

def execute(self):
"""
docker run -v <path to model>:<model in the image> qlib_image
qpte = QPTDockerEnv
qpte.run(local_path=self.XXXXpath, entry="qrun ...")
# TODO: inject exp analysis code
qpte.run(local_path=self.XXXXpath, entry="python read_exp.py")
append following code into read_exp.py
to_pickle() or to_csv() # which does not depend on environment.
read_csv or pickle in RD-Agent Env;
"""

0 comments on commit ccdbed5

Please sign in to comment.