ZhengyaoJiang / PGPortfolio

PGPortfolio: Policy Gradient Portfolio, the source code of "A Deep Reinforcement Learning Framework for the Financial Portfolio Management Problem"(https://arxiv.org/pdf/1706.10059.pdf).
GNU General Public License v3.0
1.74k stars 750 forks source link

last_w is NaN #148

Open ymxka opened 8 months ago

ymxka commented 8 months ago

In training phase, I get a assertionerror: File "E:\github\PGPortfolio\pgportfolio\learn\nnagent.py", line 153, in train self.evaluate_tensors(x, y, last_w, setw, [self.__train_operation]) File "E:\github\PGPortfolio\pgportfolio\learn\nnagent.py", line 169, in evaluate_tensors "the last_w is {}".format(last_w) AssertionError: the last_w is [[0.09090909 0.09090909 0.09090909 ... 0.09090909 0.09090909 0.09090909] [0.09090909 0.09090909 0.09090909 ... 0.09090909 0.09090909 0.09090909] [0.09090909 0.09090909 0.09090909 ... 0.09090909 0.09090909 0.09090909] ... [ nan nan nan ... nan nan nan] [ nan nan nan ... nan nan nan] [ nan nan nan ... nan nan nan]] Has anyone encountered this problem and how is it solved?