try to fix training

This commit is contained in:
Dobromir Popov
2025-06-27 00:52:38 +03:00
parent 18a6fb2fa8
commit 63f26a6749
6 changed files with 215 additions and 25 deletions

View File

@ -965,8 +965,12 @@ class WilliamsMarketStructure:
logger.info(f"CNN Training with X_shape: {X_train_batch.shape}, y_shape: {y_train_batch.shape}")
# Perform a single step of training (online learning)
# Use the wrapper's fit method, not the model's directly
self.cnn_model.fit(X_train_batch, y_train_batch, batch_size=1, epochs=1, verbose=0, callbacks=[])
logger.info(f"CNN online training step completed for pivot at index {self.previous_pivot_details_for_cnn['pivot'].index}.")
try:
self.cnn_model.fit(X_train_batch, y_train_batch, batch_size=1, epochs=1, verbose=0, callbacks=[])
logger.info(f"CNN online training step completed for pivot at index {self.previous_pivot_details_for_cnn['pivot'].index}.")
except Exception as fit_error:
logger.error(f"CNN model fit error: {fit_error}")
logger.warning("CNN training step failed - continuing without training")
else:
logger.warning("CNN Training: Skipping due to invalid X_train or y_train.")