remove emojis from console
This commit is contained in:
@@ -54,18 +54,18 @@ from utils.checkpoint_manager import get_checkpoint_manager
|
||||
|
||||
## NEVER DO THIS
|
||||
|
||||
❌ Create files with "simulator", "simulation", "mock", "fake" in the name
|
||||
❌ Use placeholder/dummy training loops
|
||||
❌ Return fake metrics or results
|
||||
❌ Skip actual model training
|
||||
Create files with "simulator", "simulation", "mock", "fake" in the name
|
||||
Use placeholder/dummy training loops
|
||||
Return fake metrics or results
|
||||
Skip actual model training
|
||||
|
||||
## ALWAYS DO THIS
|
||||
|
||||
✅ Use real model training methods
|
||||
✅ Integrate with existing training systems
|
||||
✅ Save real checkpoints
|
||||
✅ Track real metrics
|
||||
✅ Handle real data
|
||||
Use real model training methods
|
||||
Integrate with existing training systems
|
||||
Save real checkpoints
|
||||
Track real metrics
|
||||
Handle real data
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ class HistoricalDataLoader:
|
||||
# Use cached data if we have enough candles
|
||||
if len(cached_df) >= min(limit, 100): # Use cached if we have at least 100 candles
|
||||
elapsed_ms = (time.time() - start_time_ms) * 1000
|
||||
logger.debug(f"🚀 DataProvider cache hit for {symbol} {timeframe} ({len(cached_df)} candles, {elapsed_ms:.1f}ms)")
|
||||
logger.debug(f" DataProvider cache hit for {symbol} {timeframe} ({len(cached_df)} candles, {elapsed_ms:.1f}ms)")
|
||||
|
||||
# Filter by time range with direction support
|
||||
filtered_df = self._filter_by_time_range(
|
||||
@@ -177,7 +177,7 @@ class HistoricalDataLoader:
|
||||
|
||||
if df is not None and not df.empty:
|
||||
elapsed_ms = (time.time() - start_time_ms) * 1000
|
||||
logger.info(f"✅ DuckDB hit for {symbol} {timeframe} ({len(df)} candles, {elapsed_ms:.1f}ms)")
|
||||
logger.info(f" DuckDB hit for {symbol} {timeframe} ({len(df)} candles, {elapsed_ms:.1f}ms)")
|
||||
# Cache in memory
|
||||
self.memory_cache[cache_key] = (df.copy(), datetime.now())
|
||||
return df
|
||||
@@ -346,7 +346,7 @@ class HistoricalDataLoader:
|
||||
df = df.set_index('timestamp')
|
||||
df = df.sort_index()
|
||||
|
||||
logger.info(f"✅ Fetched {len(df)} candles from Binance for {symbol} {timeframe}")
|
||||
logger.info(f" Fetched {len(df)} candles from Binance for {symbol} {timeframe}")
|
||||
return df
|
||||
|
||||
except Exception as e:
|
||||
|
||||
@@ -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