From 240b52953355602f096230c7063916905745edce Mon Sep 17 00:00:00 2001 From: robcaulk Date: Wed, 31 Aug 2022 16:50:39 +0200 Subject: [PATCH] fix tensorboard path so that users can track all historical models --- config_examples/config_freqai-rl.example.json | 4 ++-- freqtrade/freqai/prediction_models/ReinforcementLearner.py | 4 ++-- .../prediction_models/ReinforcementLearner_multiproc.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config_examples/config_freqai-rl.example.json b/config_examples/config_freqai-rl.example.json index dc7c62e4a..0ba71cdca 100644 --- a/config_examples/config_freqai-rl.example.json +++ b/config_examples/config_freqai-rl.example.json @@ -72,8 +72,8 @@ "5m", "30m" ], - "indicator_max_period_candles": 10, - "indicator_periods_candles": [5] + "indicator_max_period_candles": 20, + "indicator_periods_candles": [14] }, "data_split_parameters": { "test_size": 0.5, diff --git a/freqtrade/freqai/prediction_models/ReinforcementLearner.py b/freqtrade/freqai/prediction_models/ReinforcementLearner.py index 0e156d28e..2e359d924 100644 --- a/freqtrade/freqai/prediction_models/ReinforcementLearner.py +++ b/freqtrade/freqai/prediction_models/ReinforcementLearner.py @@ -28,14 +28,14 @@ class ReinforcementLearner(BaseReinforcementLearningModel): if dk.pair not in self.dd.model_dictionary or not self.continual_learning: model = self.MODELCLASS(self.policy_type, self.train_env, policy_kwargs=policy_kwargs, - tensorboard_log=Path(dk.data_path / "tensorboard"), + tensorboard_log=Path( + dk.full_path / "tensorboard" / dk.pair.split('/')[0]), **self.freqai_info['model_training_parameters'] ) else: logger.info('Continual training activated - starting training from previously ' 'trained agent.') model = self.dd.model_dictionary[dk.pair] - model.tensorboard_log = Path(dk.data_path / "tensorboard") model.set_env(self.train_env) model.learn( diff --git a/freqtrade/freqai/prediction_models/ReinforcementLearner_multiproc.py b/freqtrade/freqai/prediction_models/ReinforcementLearner_multiproc.py index 9f6a66729..e74423a98 100644 --- a/freqtrade/freqai/prediction_models/ReinforcementLearner_multiproc.py +++ b/freqtrade/freqai/prediction_models/ReinforcementLearner_multiproc.py @@ -31,14 +31,14 @@ class ReinforcementLearner_multiproc(BaseReinforcementLearningModel): if dk.pair not in self.dd.model_dictionary or not self.continual_learning: model = self.MODELCLASS(self.policy_type, self.train_env, policy_kwargs=policy_kwargs, - tensorboard_log=Path(dk.full_path / "tensorboard"), + tensorboard_log=Path( + dk.full_path / "tensorboard" / dk.pair.split('/')[0]), **self.freqai_info['model_training_parameters'] ) else: logger.info('Continual learning activated - starting training from previously ' 'trained agent.') model = self.dd.model_dictionary[dk.pair] - model.tensorboard_log = Path(dk.data_path / "tensorboard") model.set_env(self.train_env) model.learn(