remove emojis from console
This commit is contained in:
@@ -171,23 +171,23 @@ class RealTrainingAdapter:
|
||||
if not training_data:
|
||||
raise Exception("No valid training data prepared from test cases")
|
||||
|
||||
logger.info(f"✅ Prepared {len(training_data)} training samples")
|
||||
logger.info(f" Prepared {len(training_data)} training samples")
|
||||
|
||||
# Route to appropriate REAL training method
|
||||
if model_name in ["CNN", "StandardizedCNN"]:
|
||||
logger.info("🔄 Starting CNN training...")
|
||||
logger.info(" Starting CNN training...")
|
||||
self._train_cnn_real(session, training_data)
|
||||
elif model_name == "DQN":
|
||||
logger.info("🔄 Starting DQN training...")
|
||||
logger.info(" Starting DQN training...")
|
||||
self._train_dqn_real(session, training_data)
|
||||
elif model_name == "Transformer":
|
||||
logger.info("🔄 Starting Transformer training...")
|
||||
logger.info(" Starting Transformer training...")
|
||||
self._train_transformer_real(session, training_data)
|
||||
elif model_name == "COB":
|
||||
logger.info("🔄 Starting COB training...")
|
||||
logger.info(" Starting COB training...")
|
||||
self._train_cob_real(session, training_data)
|
||||
elif model_name == "Extrema":
|
||||
logger.info("🔄 Starting Extrema training...")
|
||||
logger.info(" Starting Extrema training...")
|
||||
self._train_extrema_real(session, training_data)
|
||||
else:
|
||||
raise Exception(f"Unknown model type: {model_name}")
|
||||
@@ -196,12 +196,12 @@ class RealTrainingAdapter:
|
||||
session.status = 'completed'
|
||||
session.duration_seconds = time.time() - session.start_time
|
||||
|
||||
logger.info(f"✅ REAL training completed: {training_id} in {session.duration_seconds:.2f}s")
|
||||
logger.info(f" REAL training completed: {training_id} in {session.duration_seconds:.2f}s")
|
||||
logger.info(f" Final loss: {session.final_loss}")
|
||||
logger.info(f" Accuracy: {session.accuracy}")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"❌ REAL training failed: {e}", exc_info=True)
|
||||
logger.error(f" REAL training failed: {e}", exc_info=True)
|
||||
session.status = 'failed'
|
||||
session.error = str(e)
|
||||
session.duration_seconds = time.time() - session.start_time
|
||||
@@ -266,15 +266,15 @@ class RealTrainingAdapter:
|
||||
'close': df['close'].tolist(),
|
||||
'volume': df['volume'].tolist()
|
||||
}
|
||||
logger.debug(f" ✅ {timeframe}: {len(df)} candles")
|
||||
logger.debug(f" {timeframe}: {len(df)} candles")
|
||||
else:
|
||||
logger.warning(f" ❌ {timeframe}: No data")
|
||||
logger.warning(f" {timeframe}: No data")
|
||||
|
||||
if market_state['timeframes']:
|
||||
logger.info(f" ✅ Fetched market state with {len(market_state['timeframes'])} timeframes")
|
||||
logger.info(f" Fetched market state with {len(market_state['timeframes'])} timeframes")
|
||||
return market_state
|
||||
else:
|
||||
logger.warning(f" ❌ No market data fetched")
|
||||
logger.warning(f" No market data fetched")
|
||||
return {}
|
||||
|
||||
except Exception as e:
|
||||
@@ -309,7 +309,7 @@ class RealTrainingAdapter:
|
||||
expected_outcome = test_case.get('expected_outcome', {})
|
||||
|
||||
if not expected_outcome:
|
||||
logger.warning(f"⚠️ Skipping test case {test_case.get('test_case_id')}: missing expected_outcome")
|
||||
logger.warning(f" Skipping test case {test_case.get('test_case_id')}: missing expected_outcome")
|
||||
continue
|
||||
|
||||
# Check if market_state is provided, if not, fetch it dynamically
|
||||
@@ -320,7 +320,7 @@ class RealTrainingAdapter:
|
||||
market_state = self._fetch_market_state_for_test_case(test_case)
|
||||
|
||||
if not market_state:
|
||||
logger.warning(f"⚠️ Skipping test case {test_case.get('test_case_id')}: could not fetch market state")
|
||||
logger.warning(f" Skipping test case {test_case.get('test_case_id')}: could not fetch market state")
|
||||
continue
|
||||
|
||||
logger.debug(f" Test case {i+1}: has_market_state={bool(market_state)}, has_expected_outcome={bool(expected_outcome)}")
|
||||
@@ -339,7 +339,7 @@ class RealTrainingAdapter:
|
||||
}
|
||||
|
||||
training_data.append(entry_sample)
|
||||
logger.debug(f" ✅ Entry sample: {entry_sample['direction']} @ {entry_sample['entry_price']}")
|
||||
logger.debug(f" Entry sample: {entry_sample['direction']} @ {entry_sample['entry_price']}")
|
||||
|
||||
# Create HOLD samples (every candle while position is open)
|
||||
# This teaches the model to maintain the position until exit
|
||||
@@ -367,7 +367,7 @@ class RealTrainingAdapter:
|
||||
'repetitions': training_repetitions
|
||||
}
|
||||
training_data.append(exit_sample)
|
||||
logger.debug(f" ✅ Exit sample @ {exit_sample['exit_price']} ({exit_sample['profit_loss_pct']:.2f}%)")
|
||||
logger.debug(f" Exit sample @ {exit_sample['exit_price']} ({exit_sample['profit_loss_pct']:.2f}%)")
|
||||
|
||||
# Create NEGATIVE samples (where model should NOT trade)
|
||||
# These are candles before and after the signal
|
||||
@@ -382,14 +382,14 @@ class RealTrainingAdapter:
|
||||
logger.debug(f" ➕ Added {len(negative_samples)} negative samples (±{negative_samples_window} candles)")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"❌ Error preparing test case {i+1}: {e}")
|
||||
logger.error(f" Error preparing test case {i+1}: {e}")
|
||||
|
||||
total_entry = sum(1 for s in training_data if s.get('label') == 'ENTRY')
|
||||
total_hold = sum(1 for s in training_data if s.get('label') == 'HOLD')
|
||||
total_exit = sum(1 for s in training_data if s.get('label') == 'EXIT')
|
||||
total_no_trade = sum(1 for s in training_data if s.get('label') == 'NO_TRADE')
|
||||
|
||||
logger.info(f"✅ Prepared {len(training_data)} training samples from {len(test_cases)} test cases")
|
||||
logger.info(f" Prepared {len(training_data)} training samples from {len(test_cases)} test cases")
|
||||
logger.info(f" ENTRY samples: {total_entry}")
|
||||
logger.info(f" HOLD samples: {total_hold}")
|
||||
logger.info(f" EXIT samples: {total_exit}")
|
||||
@@ -399,7 +399,7 @@ class RealTrainingAdapter:
|
||||
logger.info(f" Ratio: 1:{total_no_trade/total_entry:.1f} (entry:no_trade)")
|
||||
|
||||
if len(training_data) < len(test_cases):
|
||||
logger.warning(f"⚠️ Skipped {len(test_cases) - len(training_data)} test cases due to missing data")
|
||||
logger.warning(f" Skipped {len(test_cases) - len(training_data)} test cases due to missing data")
|
||||
|
||||
return training_data
|
||||
|
||||
@@ -1048,7 +1048,7 @@ class RealTrainingAdapter:
|
||||
if not converted_batches:
|
||||
raise Exception("No valid training batches after conversion")
|
||||
|
||||
logger.info(f" ✅ Converted {len(training_data)} samples to {len(converted_batches)} training batches")
|
||||
logger.info(f" Converted {len(training_data)} samples to {len(converted_batches)} training batches")
|
||||
|
||||
# Train using train_step for each batch
|
||||
for epoch in range(session.total_epochs):
|
||||
|
||||
Reference in New Issue
Block a user