AI4Finance-Foundation / AI4Finance-Foundation/FinRL

"Logging Error: name 'statistics' is not defined" in FinRL_Ensemble_StockTrading_ICAIF_2020.ipynb

Ouverte
#1,353 3 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
Jupyter Notebook
Étoiles
16.3k
Forks
3.5k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

**Describe the bug**
While running `FinRL_Ensemble_StockTrading_ICAIF_2020.ipynb` with no changes (apart from incl. `!pip install pandas_market_calendars`), I received the following:

```
============Start Ensemble Strategy============
============================================
turbulence_threshold: 201.71768967803703
======Model training from: 2010-01-01 to 2021-10-04
======a2c Training========
{'n_steps': 5, 'ent_coef': 0.005, 'learning_rate': 0.0007}
Using cuda device
Logging to tensorboard_log/a2c/a2c_126_2
Logging Error: name 'statistics' is not defined
Logging Error: name 'statistics' is not defined
Logging Error: name 'statistics' is not defined
Logging Error: name 'statistics' is not defined
Logging Error: name 'statistics' is not defined
...
Logging Error: name 'statistics' is not defined
Logging Error: name 'statistics' is not defined
-------------------------------------
| time/ | |
| fps | 72 |
| iterations | 100 |
| time_elapsed | 6 |
| total_timesteps | 500 |
| train/ | |
| entropy_loss | -41.4 |
| explained_variance | 1.19e-07 |
| learning_rate | 0.0007 |
| n_updates | 99 |
| policy_loss | -60.5 |
| reward | 0.7461243 |
| reward_max | None |
| reward_mean | None |
| reward_min | None |
| std | 1.01 |
| value_loss | 3.61 |
-------------------------------------
Logging Error: name 'statistics' is not defined
Logging Error: name 'statistics' is not defined
...
Logging Error: name 'statistics' is not defined
Logging Error: name 'statistics' is not defined
--------------------------------------
| time/ | |
| fps | 78 |
| iterations | 200 |
| time_elapsed | 12 |
| total_timesteps | 1000 |
| train/ | |
| entropy_loss | -41.4 |
| explained_variance | 0 |
| learning_rate | 0.0007 |
| n_updates | 199 |
| policy_loss | -84.3 |
| reward | 0.83888245 |
| reward_max | None |
| reward_mean | None |
| reward_min | None |
| std | 1.01 |
| value_loss | 12.3 |
--------------------------------------
Logging Error: name 'statistics' is not defined
Logging Error: name 'statistics' is not defined
...
Logging Error: name 'statistics' is not defined
--------------------------------------
| time/ | |
| fps | 84 |
| iterations | 300 |
| time_elapsed | 17 |
| total_timesteps | 1500 |
| train/ | |
| entropy_loss | -41.4 |
| explained_variance | 0 |
| learning_rate | 0.0007 |
| n_updates | 299 |
| policy_loss | -96.5 |
| reward | -1.7435927 |
| reward_max | None |
| reward_mean | None |
| reward_min | None |
| std | 1.01 |
| value_loss | 12.3 |
--------------------------------------
```

while running the cell:

```
df_summary = ensemble_agent.run_ensemble_strategy(A2C_model_kwargs,
PPO_model_kwargs,
DDPG_model_kwargs,
SAC_model_kwargs,
TD3_model_kwargs,
timesteps_dict)
```

While it does continue to run as expected in between the multitude of logging errors, not sure what I could be doing wrong/changed since this Notebook's implementation.

Thanks in advance!

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.