tweaks, try live trading

This commit is contained in:
Dobromir Popov
2025-07-08 01:33:22 +03:00
parent 9cd2d5d8a4
commit 4ab7bc1846
8 changed files with 141 additions and 201 deletions

View File

@ -229,9 +229,12 @@ class TrainingIntegration:
# Truncate
features = features[:50]
# Get the model's device to ensure tensors are on the same device
model_device = next(cnn_model.parameters()).device
# Create tensors
features_tensor = torch.FloatTensor(features).unsqueeze(0).to(device)
target_tensor = torch.LongTensor([target]).to(device)
features_tensor = torch.FloatTensor(features).unsqueeze(0).to(model_device)
target_tensor = torch.LongTensor([target]).to(model_device)
# Training step
cnn_model.train()