Skip to content

Commit

Permalink
Uploaded Documentation & Further Improved Demo of Models
Browse files Browse the repository at this point in the history
  • Loading branch information
xisen-w committed Aug 1, 2024
1 parent d297f55 commit f7e9c94
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 5 deletions.
87 changes: 86 additions & 1 deletion docs/scenarios_and_quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,89 @@ To quickly start the factor extraction process, run the following command in you
Usage of modules
~~~~~~~~~~~~~~~~~
TODO: Show some examples:
TODO: Show some examples:

Scen3:
------
🤖 Automated Machine Learning Model Construction & Iteration in Quantitative Finance
Scen3 Intro
~~~~~~~~~~~
In this scenario, our automated system proposes hypothesis, constructs model, implements code, receives back-testing, and uses feedbacks. Hypothesis is iterated in this continuous process. The system aims to automatically optimise performance metrics from Qlib library thereby finding the optimised code through autonomous research and development.

Automated R&D of model in Quantitative Finance
~~~~~~~~~~~~~
**R (Research)**
- Iteration of ideas and hypotheses.
- Continuous learning and knowledge construction.

**D (Development)**
- Evolving code generation and model refinement.
- Automated implementation and testing of models.

Objective
~~~~~~~~~
The demo showcases the iterative process of hypothesis generation, knowledge construction, and decision-making in model construction in quantitative finance. It highlights how models evolve through continuous feedback and refinement, therefore building the domain knowledge specific to the scenario of quantitative finance.

Scen3 Demo
~~~~~~~~~~
.. TODO
Scen3 Quick Start
~~~~~~~~~~~~~~~~~

To quickly start the model proposal process, run the following command in your terminal within the 'rdagent' virtual environment:

.. code-block:: sh
python rdagent/app/qlib_rd_loop/model_w_sc.py
Usage of modules
~~~~~~~~~~~~~~~~~
TODO: Show some examples:

Scen4:
------
🤖 Automated Model Research & Development Co-Pilot

Scen4 Intro
~~~~~~~~~~~
In this scenario, our automated system proposes hypotheses, constructs models, implements code, performs back-testing, and uses feedback to iterate continuously. The system aims to automatically optimize performance metrics from the Qlib library, finding the best code through autonomous research and development.

Model R&D CoPilot Scenario
~~~~~~~~~~~~~~~~~~~~~~
**Overview**

This demo automates the extraction and iterative development of models from academic papers, ensuring functionality and correctness. This scenario automates the development of PyTorch models by reading academic papers or other sources. It supports various data types, including tabular, time-series, and graph data. The primary workflow involves two main components: the Reader and the Coder.

**Workflow Components**

1. **Reader**
- Parses and extracts relevant model information from academic papers or sources, including architectures, parameters, and implementation details.
- Uses Large Language Models to convert content into a structured format for the Coder.

2. **Evolving Coder**
- Translates structured information from the Reader into executable PyTorch code.
- Utilizes an evolving coding mechanism to ensure correct tensor shapes, verified with sample input tensors.
- Iteratively refines the code to align with source material specifications.

#### Supported Data Types

- **Tabular Data:** Structured data with rows and columns, such as spreadsheets or databases.
- **Time-Series Data:** Sequential data points indexed in time order, useful for forecasting and temporal pattern recognition.
- **Graph Data:** Data structured as nodes and edges, suitable for network analysis and relational tasks.

Scen4 Demo
~~~~~~~~~~
.. TODO
Scen4 Quick Start
~~~~~~~~~~~~~~~~~
To quickly start the model proposal process, run the following command in your terminal within the 'rdagent' virtual environment:

.. code-block:: sh
python rdagent/app/model_extraction_and_code/model_extraction_and_implementation.py
Usage of modules
~~~~~~~~~~~~~~~~~
TODO: Show some examples

2 changes: 1 addition & 1 deletion rdagent/app/model_extraction_and_code/GeneralModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def simulator(self) -> str:
@property
def rich_style_description(self) -> str:
return """
# [General Model Research Co-Pilot] (#_scenario)
# [Model Research & Development Co-Pilot] (#_scenario)
## [Overview](#_summary)
Expand Down
4 changes: 2 additions & 2 deletions rdagent/components/proposal/prompts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ hypothesis_gen:
{{ hypothesis_output_format }}
Here are the specifications: {{ hypothesis_specification }}
user_prompt: |-
The user has made several hypothesis on this scenario and did several evaluation on them.
If it is not the first round, then the user has made several hypothesis on this scenario and did several evaluation on them.
The former hypothesis and the corresponding feedbacks are as follows (focus on the last one & the new hypothesis that it provides and reasoning to see if you agree):
{{ hypothesis_and_feedback }}
To help you generate new {{targets}}, we have prepared the following information for you:
{{ RAG }}
Please generate the new hypothesis based on the information above. Also generate the relevant keys for the reasoning and the distilled knowledge that follows.
Please generate the new hypothesis based on the information above. Also generate the relevant keys for the reasoning and the distilled knowledge that follows. For those keys, in particular for knowledge, explain in the context of the specific scenario to build up domain knowledge in the specific field rather than genearl knowledge.
hypothesis2experiment:
system_prompt: |-
Expand Down
2 changes: 1 addition & 1 deletion rdagent/scenarios/qlib/prompts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ hypothesis_output_format: |-
"concise_reason": Two line summary. First line focuses on the a concise justification for the change. 2nd Line learns from first line and previous experiences (hypothesis & experiments & code & feedbacks) to generalise a knowledge statement (use tend to/because/if/generally/etc. ). This is the summary of the three keys below.
"concise_observation": One line summary. It focuses on the observation of the given scenario, data characteristics, or previous experiences (failures & succeses).
"concise_justification": One line summary. It focuses on the justification for the change in new hypothesis and the route of exploration supporting the growth of the hypothesis, based on the observation.
"concise_knowledge": One line summary. It focuses on a transferable knowledege that comes with the new hypothesis. Use conditional grammar. eg. "If...., ..; When..., .; and etc"
"concise_knowledge": One line summary. It focuses on a transferable knowledege that comes with the new hypothesis. Use conditional grammar. eg. "If...., ..; When..., .; and etc" Make sure that you state things clearly without ambiguity. Eg. avoid saying "previous hypothesis", because one wouldn't know what that is.
}
model_hypothesis_specification: |-
Expand Down

0 comments on commit f7e9c94

Please sign in to comment.