-
Notifications
You must be signed in to change notification settings - Fork 34
Write an advanced usage section #64
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -144,3 +144,43 @@ Execute the following steps in a PowerShell terminal: | |||||||
| 8. Open [Docker Desktop](https://www.docker.com/products/docker-desktop/) and leave it opened in the background. | ||||||||
|
|
||||||||
| Now, open a Git Bash terminal and follow the instructions in the "[Run the script](#run-the-script)" section as well as the subsequent sections. You might need to install Microsoft Visual C++ 14.0 or greater. | ||||||||
|
|
||||||||
| ## Advanced usage | ||||||||
|
|
||||||||
| This chapter is for advanced users who want to further customize the trader agent's behaviour without changing the underlying trading logic. | ||||||||
|
|
||||||||
| ##### Policy weights | ||||||||
|
|
||||||||
| This script automatically sets some default weights to the agent's policy as a warm start | ||||||||
| to help convergence and improve tool selection. | ||||||||
| These data were obtained after many days of running the service and are set | ||||||||
| [here](https://github.com/valory-xyz/trader-quickstart/blob/0f093ebbf0857b8484a017912c3992f00fbe1a29/run_service.sh#L133-L137). | ||||||||
| As a result, the current weights are always deleted and replaced by this strategy | ||||||||
| which is considered to boost the initial performance of the service. | ||||||||
|
|
||||||||
| However, you may have found better performing policy weights and would like to remove this logic. | ||||||||
| It can easily be done, by removing this method call, | ||||||||
| [here](https://github.com/valory-xyz/trader-quickstart/blob/0f093ebbf0857b8484a017912c3992f00fbe1a29/run_service.sh#L698), | ||||||||
| in order to set your own custom warm start. | ||||||||
| Setting your own custom weights can be done by editing the corresponding files in `.trader_runner`. | ||||||||
| Moreover, you may store your current policy as a backup before editing those files, using the following command: | ||||||||
|
|
||||||||
| ```shell | ||||||||
| cp ".trader_runner/available_tools_store.json" ".trader_runner/available_tools_store_$(date +"%d-%m-%Y")".json | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| ``` | ||||||||
|
|
||||||||
| ##### Tool selection | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Step 1 should be to tell the user about the env variable that adjusts the policy punishment
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not have an environment variable for the punishment, this is fixed to the mech's price.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Opened an issue valory-xyz/trader#120 I suggest we close this comment. |
||||||||
|
|
||||||||
| Sometimes, a mech tool might temporarily return invalid results. | ||||||||
| As a result, the service would end up performing mech calls without being able to use the response. | ||||||||
| Assuming that this tool has a large reward rate in the policy weights, | ||||||||
| the service might end up spending a considerable amount of xDAI before adjusting the tool's reward rate, | ||||||||
| without making any progress. | ||||||||
| If a tool is temporarily misbehaving, you could use an environment variable in order to exclude it. | ||||||||
| This environment variable is defined | ||||||||
| [here](https://github.com/valory-xyz/trader/blob/v0.8.0/packages/valory/services/trader/service.yaml#L109-L112) | ||||||||
| and can be overriden by setting it anywhere in the `run_service.sh` script with a new value, e.g.: | ||||||||
|
|
||||||||
| ```shell | ||||||||
| IRRELEVANT_TOOLS=["some-misbehaving-tool", "openai-text-davinci-002", "openai-text-davinci-003", "openai-gpt-3.5-turbo", "openai-gpt-4", "stabilityai-stable-diffusion-v1-5", "stabilityai-stable-diffusion-xl-beta-v2-2-2", "stabilityai-stable-diffusion-512-v2-1", "stabilityai-stable-diffusion-768-v2-1"] | ||||||||
| ``` | ||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can we not simply say: if you want a different warm start adjust such and such file?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the function call needs to be removed as well, to avoid overwriting the files' contents.