feat: Add Protocol 13 adaptive optimization, Plotly charts, and dashboard improvements
## Protocol 13: Adaptive Multi-Objective Optimization - Iterative FEA + Neural Network surrogate workflow - Initial FEA sampling, NN training, NN-accelerated search - FEA validation of top NN predictions, retraining loop - adaptive_state.json tracks iteration history and best values - M1 mirror study (V11) with 103 FEA, 3000 NN trials ## Dashboard Visualization Enhancements - Added Plotly.js interactive charts (parallel coords, Pareto, convergence) - Lazy loading with React.lazy() for performance - Code splitting: plotly.js-basic-dist (~1MB vs 3.5MB) - Chart library toggle (Recharts default, Plotly on-demand) - ExpandableChart component for full-screen modal views - ConsoleOutput component for real-time log viewing ## Documentation - Protocol 13 detailed documentation - Dashboard visualization guide - Plotly components README - Updated run-optimization skill with Mode 5 (adaptive) ## Bug Fixes - Fixed TypeScript errors in dashboard components - Fixed Card component to accept ReactNode title - Removed unused imports across components 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -314,17 +314,33 @@ def create_reference_graph(num_nodes: int = 500, device: torch.device = None):
|
||||
# Create simple node features (placeholder)
|
||||
x = torch.randn(num_nodes, 12, device=device)
|
||||
|
||||
# Create grid-like connectivity
|
||||
# Create grid-like connectivity - ensure valid indices
|
||||
edges = []
|
||||
grid_size = int(np.sqrt(num_nodes))
|
||||
grid_size = int(np.ceil(np.sqrt(num_nodes)))
|
||||
|
||||
for i in range(num_nodes):
|
||||
# Connect to neighbors
|
||||
if i % grid_size < grid_size - 1: # Right neighbor
|
||||
edges.append([i, i + 1])
|
||||
edges.append([i + 1, i])
|
||||
if i + grid_size < num_nodes: # Bottom neighbor
|
||||
edges.append([i, i + grid_size])
|
||||
edges.append([i + grid_size, i])
|
||||
row = i // grid_size
|
||||
col = i % grid_size
|
||||
|
||||
# Right neighbor (same row)
|
||||
right = i + 1
|
||||
if col < grid_size - 1 and right < num_nodes:
|
||||
edges.append([i, right])
|
||||
edges.append([right, i])
|
||||
|
||||
# Bottom neighbor (next row)
|
||||
bottom = i + grid_size
|
||||
if bottom < num_nodes:
|
||||
edges.append([i, bottom])
|
||||
edges.append([bottom, i])
|
||||
|
||||
# Ensure we have at least some edges
|
||||
if len(edges) == 0:
|
||||
# Fallback: fully connected for very small graphs
|
||||
for i in range(num_nodes):
|
||||
for j in range(i + 1, min(i + 5, num_nodes)):
|
||||
edges.append([i, j])
|
||||
edges.append([j, i])
|
||||
|
||||
edge_index = torch.tensor(edges, dtype=torch.long, device=device).t().contiguous()
|
||||
edge_attr = torch.randn(edge_index.shape[1], 5, device=device)
|
||||
|
||||
Reference in New Issue
Block a user