Skip to main content

Common Issues

No Spikes Detected

Symptoms:
  • TensorBoard shows Spikes/total_count = 0
  • Agent behavior is random/static
  • Episode rewards flat or declining
Causes:
  1. CL1 device not connected
  2. UDP port mismatch
  3. Firewall blocking UDP
  4. Network latency/packet loss
Solutions:
From cl1_neural_interface.py:200-220:
Add debug logging:
From cl1_neural_interface.py:173-200:
Verify stimulation parameters:
  • frequencies in range [4.0, 40.0] Hz
  • amplitudes in range [1.0, 2.5] μA
  • phase1_duration and phase2_duration = 160 μs

Training Divergence

Symptoms:
  • Reward suddenly drops to zero
  • Policy outputs NaN values
  • Gradient norms explode (>100)
Causes:
  1. Learning rate too high
  2. Gradient clipping too weak
  3. Unnormalized returns causing value explosion
Solutions:
From TensorBoard:
Watch these metrics:
  • Training/Policy_Grad_Norm (should stay < 10)
  • Training/Value_Grad_Norm (should stay < 10)
  • Training/Encoder_Grad_Norm (if encoder trainable)
If norms consistently hit max_grad_norm, gradients are being clipped. Reduce learning rate.
Add logging to ppo_doom.py:
Common causes:
  • Division by zero in normalization
  • Exploding decoder weights (check L2 regularization)
  • Invalid spike counts (negative values)

Low Reward Despite Good Behavior

Symptoms:
  • Agent visibly plays well (kills enemies, picks up items)
  • TensorBoard shows low Episode_Reward
  • Feedback stimulation seems ineffective
Causes:
  1. Reward shaping misconfigured
  2. Feedback thresholds too strict
  3. Event feedback channels misconfigured From ppo_doom.py:165-257, check event_feedback_settings:
Solutions:
From README.md line 149:
simplified_reward=True disables manually shaped aim alignment and velocity. I did more tuning on False so it’s probably better kept this way.
For deadly corridor:
Check UDP packet transmission:
Inspect feedback_port logs for:
  • Packet send count
  • Amplitude/frequency values
  • Channel assignments
From training_server.py, feedback is sent via:

Decoder Bias Dominating

Symptoms:
  • Decoder/forward_wx_bias_ratio < 1.0 (bias larger than weight*input)
  • Ablation modes (zero, random) show similar performance to real spikes
  • Agent behavior unchanged when neurons are silenced
Causes:
  1. decoder_zero_bias=False (default in some configs)
  2. Decoder MLP learning a static policy
  3. Encoder not trainable
Solutions:
See Ablation Modes page.Quick test:
Compare TensorBoard metrics. If both show similar reward curves, decoder bias is dominating.
From ppo_doom.py:718-744:
In TensorBoard, check:
  • Decoder/forward_wx_bias_ratio (should be > 1.0)
  • Decoder/attack_wx_bias_ratio
  • Decoder/camera_wx_bias_ratio
If ratios < 1.0, bias is larger than weighted input.

Network Connectivity Issues

Symptoms:
  • cl1_neural_interface.py reports “Connection timeout”
  • Training server logs “No spike data received”
  • Sporadic packet loss
Causes:
  1. IP address mismatch
  2. Port already in use
  3. Network latency
Solutions:
From cl1_neural_interface.py:145-171:
Verify output:
If packets don’t arrive, check:
  • Firewall rules (sudo ufw status)
  • Routing tables (ip route)
  • Network interface config (ifconfig)

TensorBoard Monitoring

Essential Metrics

From README.md lines 60-67:

Key Plots

Episode Reward (Training/Episode_Reward)
  • Should increase over time
  • High variance early (exploration)
  • Plateaus indicate convergence or need for curriculum change
Kill Count (Training/Kill_Count)
  • Tracks combat effectiveness
  • Should correlate with reward
  • Flat = agent not engaging enemies
Survival Time (Training/Survival_Time)
  • Longer = better policy
  • Sudden drops = environment difficulty increase or policy collapse
Total Spike Count (Spikes/total_count)
  • Should be > 0 every episode
  • If zero, check CL1 connection and stimulation
Spikes per Channel Set (Spikes/encoding, Spikes/move_forward, etc.)
  • Shows which channels are active
  • Uneven distribution may indicate channel imbalance
Stimulation Parameters (Encoder/freq_mean, Encoder/amp_mean)
  • Frequencies should be in [4.0, 40.0] Hz
  • Amplitudes in [1.0, 2.5] μA
  • Stuck values = encoder not learning
Policy Gradient Norm (Training/Policy_Grad_Norm)
  • Should stay < max_grad_norm (default 3.0)
  • Consistently hitting limit = reduce learning rate
Entropy (Training/Entropy)
  • Measures policy randomness
  • High early (exploration), decreases over time
  • Too low too fast = premature convergence
KL Divergence (Training/KL_Divergence)
  • Measures policy change between updates
  • Should be small (< 0.1)
  • Large spikes = policy instability
wx/bias Ratio (Decoder/forward_wx_bias_ratio)
  • Should be > 1.0 (weights dominate bias)
  • < 1.0 = decoder bias is compensating for spikes
  • If decoder_zero_bias=True, bias metrics will be zero
Weight L2 Norm (Decoder/weight_l2)
  • Tracks decoder weight magnitude
  • Explosion (>1000) = add L2 regularization
Bias Absolute Mean (Decoder/forward_bias_abs_mean)
  • Should be near zero if decoder_zero_bias=True
  • Growing bias = decoder learning static policy

Custom Logging

Add debugging metrics to ppo_doom.py:

Debugging Commands

Check Process Status

Monitor Resource Usage

Inspect Checkpoints

Test Neural Interface

Getting Help

Collecting Diagnostic Info

Common Error Messages

Solution:Reduce batch size or steps per update:
Or switch to CPU:
Solution:CL1 device not running or wrong IP:
Solution:From ppo_doom.py:285-350, forbidden channels are .Edit channel assignments:

Reporting Issues

Include:
  1. Full command used to start training/CL1
  2. TensorBoard screenshots of key metrics
  3. Last 50 lines of logs
  4. Configuration used (PPOConfig values)
  5. Network topology (IP addresses, ports)
  6. System specs (GPU, RAM, OS)