add multiproc fix flake8

This commit is contained in:
smarmau 2022-12-03 22:30:04 +11:00 committed by GitHub
parent 469aa0d43f
commit d6f45a12ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -134,7 +134,7 @@ class ReinforcementLearner(BaseReinforcementLearningModel):
factor = 100.
# reward agent for entering trades
if (action ==Actions.Long_enter.value
if (action == Actions.Long_enter.value
and self._position == Positions.Neutral):
self.custom_info[f"{Actions.Long_enter.name}"] += 1
return 25

View File

@ -8,7 +8,7 @@ from stable_baselines3.common.vec_env import SubprocVecEnv
from freqtrade.freqai.data_kitchen import FreqaiDataKitchen
from freqtrade.freqai.prediction_models.ReinforcementLearner import ReinforcementLearner
from freqtrade.freqai.RL.BaseReinforcementLearningModel import make_env
from freqtrade.freqai.RL.BaseReinforcementLearningModel import TensorboardCallback, make_env
logger = logging.getLogger(__name__)
@ -49,3 +49,5 @@ class ReinforcementLearner_multiproc(ReinforcementLearner):
self.eval_callback = EvalCallback(self.eval_env, deterministic=True,
render=False, eval_freq=len(train_df),
best_model_save_path=str(dk.data_path))
self.tensorboard_callback = TensorboardCallback()