AI4Finance-Foundation / FinRL

FinRL: Financial Reinforcement Learning. 🔥
https://ai4finance.org
MIT License
9.71k stars 2.36k forks source link

Reproducibility Issue of Stablebaseline3 ( FinRL ) #1141

Open RupeshKeesaram opened 9 months ago

RupeshKeesaram commented 9 months ago

Hello everyone, I've been trying to work with FinRL ( Stablebaseline3), everything is fine except the reproducibility issue ( I'm getting inconsistent results every time I run my model ). I've seen a GitHub issue where community tried raising issue on the same, but it got closed without any conversation or solution.

Github Issue Link : https://github.com/AI4Finance-Foundation/FinRL/issues/190

It would be great if anyone can help me to fix this issue or suggest something that can help me to solve the issue.

Thanks in advance.

zhumingpassional commented 9 months ago

Stability and reproducibility are two common issues for the RL, since there are many local optima.

I suggest to try some skills, e.g., fix seeds, ensemble strategy, select the best one over multiple agents.

RupeshKeesaram commented 9 months ago

I'll agree, I've tried the seeding for my environment & for the algorithms also but they're not giving me the same results. Is it like even after trying the seeding it's unlikely to produce same results ? or I'm doing anything wrong because of which I'm getting inconsistent results ?

zhumingpassional commented 9 months ago

I do not know how you set seeds. I am not sure if current RL lib such as SB3 has opened the seed setting.

RupeshKeesaram commented 9 months ago

Please check the below code snippet, this is what I've tried when you mean seeding.

Screenshot 2023-12-23 114644

@zhumingpassional help me if I'm doing something wrong or if there's something that can be tried on top of this.

zhumingpassional commented 9 months ago

we may not set seeds for SB3.

pls submit issues on SB3 github for this question.