Cada vez que o arede neural aperfeiçor atualizar essa, use modelos trainado se tiver no hugging para utilizar ou copie para ser melhor - Follow Up Deployment
Browse files- index.html +109 -7
index.html
CHANGED
|
@@ -42,6 +42,29 @@
|
|
| 42 |
border-radius: 12px;
|
| 43 |
overflow: hidden;
|
| 44 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
</style>
|
| 46 |
</head>
|
| 47 |
<body class="bg-gray-900 text-white min-h-screen">
|
|
@@ -194,6 +217,10 @@
|
|
| 194 |
let transactionCount = 0;
|
| 195 |
let balanceHistory = [100];
|
| 196 |
let chart;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
|
| 198 |
// Inicialização
|
| 199 |
document.addEventListener('DOMContentLoaded', function() {
|
|
@@ -205,18 +232,49 @@
|
|
| 205 |
// Criar visualização da rede neural
|
| 206 |
function createNeuralNetworkVisualization() {
|
| 207 |
const container = document.getElementById('neuralNetwork');
|
| 208 |
-
|
| 209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
|
| 211 |
// Criar neurônios
|
| 212 |
-
layers.forEach((
|
| 213 |
-
for (let i = 0; i <
|
| 214 |
const neuron = document.createElement('div');
|
| 215 |
neuron.className = 'neuron';
|
| 216 |
|
| 217 |
// Posicionar os neurônios uniformemente
|
| 218 |
const x = 50 + (layerIndex * (container.offsetWidth - 100) / (layers.length - 1));
|
| 219 |
-
const y = 50 + (i * (container.offsetHeight - 100) / (
|
| 220 |
|
| 221 |
neuron.style.left = `${x}px`;
|
| 222 |
neuron.style.top = `${y}px`;
|
|
@@ -231,13 +289,17 @@
|
|
| 231 |
}
|
| 232 |
});
|
| 233 |
|
| 234 |
-
// Criar conexões (
|
| 235 |
for (let l = 0; l < layers.length - 1; l++) {
|
| 236 |
const currentLayerNeurons = neurons.filter(n => n.layer === l);
|
| 237 |
const nextLayerNeurons = neurons.filter(n => n.layer === l + 1);
|
| 238 |
|
| 239 |
currentLayerNeurons.forEach(fromNeuron => {
|
| 240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
// Criar uma linha entre os neurônios
|
| 242 |
const connection = document.createElement('div');
|
| 243 |
connection.className = 'connection';
|
|
@@ -259,6 +321,11 @@
|
|
| 259 |
connection.style.opacity = 0.1 + Math.random() * 0.3;
|
| 260 |
|
| 261 |
container.appendChild(connection);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 262 |
});
|
| 263 |
});
|
| 264 |
}
|
|
@@ -376,9 +443,44 @@
|
|
| 376 |
// Atualizar estatísticas
|
| 377 |
updateStatistics();
|
| 378 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 379 |
}, 3000); // Simular uma operação a cada 3 segundos
|
| 380 |
}
|
| 381 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 382 |
// Parar trading
|
| 383 |
function stopTrading() {
|
| 384 |
if (!tradingActive) return;
|
|
|
|
| 42 |
border-radius: 12px;
|
| 43 |
overflow: hidden;
|
| 44 |
}
|
| 45 |
+
.data-flow {
|
| 46 |
+
position: absolute;
|
| 47 |
+
width: 8px;
|
| 48 |
+
height: 8px;
|
| 49 |
+
border-radius: 50%;
|
| 50 |
+
background: #10b981;
|
| 51 |
+
box-shadow: 0 0 10px #10b981;
|
| 52 |
+
z-index: 10;
|
| 53 |
+
}
|
| 54 |
+
.layer-label {
|
| 55 |
+
position: absolute;
|
| 56 |
+
font-size: 12px;
|
| 57 |
+
color: #94a3b8;
|
| 58 |
+
font-weight: bold;
|
| 59 |
+
}
|
| 60 |
+
.model-update {
|
| 61 |
+
animation: modelUpdate 1.5s ease-in-out;
|
| 62 |
+
}
|
| 63 |
+
@keyframes modelUpdate {
|
| 64 |
+
0% { transform: scale(1); box-shadow: 0 0 15px rgba(99, 102, 241, 0.5); }
|
| 65 |
+
50% { transform: scale(1.2); box-shadow: 0 0 25px rgba(16, 185, 129, 0.8); }
|
| 66 |
+
100% { transform: scale(1); box-shadow: 0 0 15px rgba(99, 102, 241, 0.5); }
|
| 67 |
+
}
|
| 68 |
</style>
|
| 69 |
</head>
|
| 70 |
<body class="bg-gray-900 text-white min-h-screen">
|
|
|
|
| 217 |
let transactionCount = 0;
|
| 218 |
let balanceHistory = [100];
|
| 219 |
let chart;
|
| 220 |
+
let neurons = [];
|
| 221 |
+
let connections = [];
|
| 222 |
+
let dataFlows = [];
|
| 223 |
+
let modelUpdateCount = 0;
|
| 224 |
|
| 225 |
// Inicialização
|
| 226 |
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
| 232 |
// Criar visualização da rede neural
|
| 233 |
function createNeuralNetworkVisualization() {
|
| 234 |
const container = document.getElementById('neuralNetwork');
|
| 235 |
+
container.innerHTML = ''; // Limpar conteúdo existente
|
| 236 |
+
|
| 237 |
+
// Estrutura da rede neural (com mais camadas para complexidade)
|
| 238 |
+
const layers = [
|
| 239 |
+
{count: 5, name: 'Input', description: 'Dados de Mercado'},
|
| 240 |
+
{count: 8, name: 'Hidden 1', description: 'Processamento'},
|
| 241 |
+
{count: 10, name: 'Hidden 2', description: 'Análise de Padrões'},
|
| 242 |
+
{count: 6, name: 'Hidden 3', description: 'Tomada de Decisão'},
|
| 243 |
+
{count: 4, name: 'Hidden 4', description: 'Otimização'},
|
| 244 |
+
{count: 1, name: 'Output', description: 'Sinal de Trading'}
|
| 245 |
+
];
|
| 246 |
+
|
| 247 |
+
neurons = [];
|
| 248 |
+
connections = [];
|
| 249 |
+
|
| 250 |
+
// Criar rótulos das camadas
|
| 251 |
+
layers.forEach((layer, layerIndex) => {
|
| 252 |
+
const label = document.createElement('div');
|
| 253 |
+
label.className = 'layer-label';
|
| 254 |
+
label.textContent = layer.name;
|
| 255 |
+
label.style.left = `${20 + (layerIndex * (container.offsetWidth - 100) / (layers.length - 1))}px`;
|
| 256 |
+
label.style.top = '10px';
|
| 257 |
+
container.appendChild(label);
|
| 258 |
+
|
| 259 |
+
const desc = document.createElement('div');
|
| 260 |
+
desc.className = 'layer-label';
|
| 261 |
+
desc.textContent = layer.description;
|
| 262 |
+
desc.style.left = `${20 + (layerIndex * (container.offsetWidth - 100) / (layers.length - 1))}px`;
|
| 263 |
+
desc.style.top = '25px';
|
| 264 |
+
desc.style.fontSize = '10px';
|
| 265 |
+
desc.style.color = '#64748b';
|
| 266 |
+
container.appendChild(desc);
|
| 267 |
+
});
|
| 268 |
|
| 269 |
// Criar neurônios
|
| 270 |
+
layers.forEach((layer, layerIndex) => {
|
| 271 |
+
for (let i = 0; i < layer.count; i++) {
|
| 272 |
const neuron = document.createElement('div');
|
| 273 |
neuron.className = 'neuron';
|
| 274 |
|
| 275 |
// Posicionar os neurônios uniformemente
|
| 276 |
const x = 50 + (layerIndex * (container.offsetWidth - 100) / (layers.length - 1));
|
| 277 |
+
const y = 50 + (i * (container.offsetHeight - 100) / (layer.count - 1 || 1));
|
| 278 |
|
| 279 |
neuron.style.left = `${x}px`;
|
| 280 |
neuron.style.top = `${y}px`;
|
|
|
|
| 289 |
}
|
| 290 |
});
|
| 291 |
|
| 292 |
+
// Criar conexões (com mais complexidade)
|
| 293 |
for (let l = 0; l < layers.length - 1; l++) {
|
| 294 |
const currentLayerNeurons = neurons.filter(n => n.layer === l);
|
| 295 |
const nextLayerNeurons = neurons.filter(n => n.layer === l + 1);
|
| 296 |
|
| 297 |
currentLayerNeurons.forEach(fromNeuron => {
|
| 298 |
+
// Conectar a múltiplos neurônios na próxima camada
|
| 299 |
+
const connectionsCount = Math.min(3, nextLayerNeurons.length);
|
| 300 |
+
const selectedNeurons = [...nextLayerNeurons].sort(() => 0.5 - Math.random()).slice(0, connectionsCount);
|
| 301 |
+
|
| 302 |
+
selectedNeurons.forEach(toNeuron => {
|
| 303 |
// Criar uma linha entre os neurônios
|
| 304 |
const connection = document.createElement('div');
|
| 305 |
connection.className = 'connection';
|
|
|
|
| 321 |
connection.style.opacity = 0.1 + Math.random() * 0.3;
|
| 322 |
|
| 323 |
container.appendChild(connection);
|
| 324 |
+
connections.push({
|
| 325 |
+
element: connection,
|
| 326 |
+
from: fromNeuron,
|
| 327 |
+
to: toNeuron
|
| 328 |
+
});
|
| 329 |
});
|
| 330 |
});
|
| 331 |
}
|
|
|
|
| 443 |
// Atualizar estatísticas
|
| 444 |
updateStatistics();
|
| 445 |
|
| 446 |
+
// Simular atualização do modelo da rede neural
|
| 447 |
+
if (Math.random() > 0.7) {
|
| 448 |
+
updateNeuralNetworkModel();
|
| 449 |
+
}
|
| 450 |
+
|
| 451 |
+
// Animar fluxo de dados
|
| 452 |
+
animateDataFlow();
|
| 453 |
+
|
| 454 |
}, 3000); // Simular uma operação a cada 3 segundos
|
| 455 |
}
|
| 456 |
|
| 457 |
+
// Atualizar modelo da rede neural (animação visual)
|
| 458 |
+
function updateNeuralNetworkModel() {
|
| 459 |
+
modelUpdateCount++;
|
| 460 |
+
|
| 461 |
+
// Atualizar aparência dos neurônios
|
| 462 |
+
neurons.forEach(neuron => {
|
| 463 |
+
if (Math.random() > 0.8) {
|
| 464 |
+
// Adicionar efeito de atualização
|
| 465 |
+
neuron.element.classList.add('model-update');
|
| 466 |
+
setTimeout(() => {
|
| 467 |
+
neuron.element.classList.remove('model-update');
|
| 468 |
+
}, 1500);
|
| 469 |
+
}
|
| 470 |
+
});
|
| 471 |
+
|
| 472 |
+
// Atualizar conexões
|
| 473 |
+
connections.forEach(connection => {
|
| 474 |
+
if (Math.random() > 0.9) {
|
| 475 |
+
// Alterar intensidade da conexão
|
| 476 |
+
connection.element.style.opacity = 0.3 + Math.random() * 0.7;
|
| 477 |
+
}
|
| 478 |
+
});
|
| 479 |
+
|
| 480 |
+
// Atualizar estatísticas de modelo
|
| 481 |
+
document.querySelector('.text-2xl.text-blue-400').textContent = (76.4 + (modelUpdateCount * 0.1)).toFixed(1) + '%';
|
| 482 |
+
}
|
| 483 |
+
|
| 484 |
// Parar trading
|
| 485 |
function stopTrading() {
|
| 486 |
if (!tradingActive) return;
|