EventFeedbackConfig
TheEventFeedbackConfig dataclass defines parameters for event-triggered feedback stimulation. Each in-game event (enemy kills, damage, armor pickup, etc.) can have its own feedback configuration that dynamically scales stimulation parameters based on TD error magnitude.
Core Parameters
List of channel indices to stimulate when this event occurs. Each event should use a unique set of channels to provide distinct feedback signals.
Base stimulation frequency in Hertz (Hz). This is the baseline frequency before any TD error scaling is applied.
Base stimulation amplitude in microamps (μA). This is the baseline amplitude before any TD error scaling is applied.
Base number of pulses to deliver for this event. This is the baseline pulse count before any TD error scaling is applied.
Key name used to identify this event in the game info dictionary. Used to trigger the appropriate feedback when events occur.
TD Error Configuration
Which TD error signals trigger this feedback:
positive: Only trigger on positive TD errors (better than expected)negative: Only trigger on negative TD errors (worse than expected)absolute: Trigger on any TD error magnitude
Frequency Scaling
Gain multiplier for TD error to frequency scaling. Higher values make frequency more sensitive to TD error magnitude.
Maximum scaling factor for frequency. Final frequency =
base_frequency * scale, where scale is clamped to [1.0, freq_max_scale].Amplitude Scaling
Gain multiplier for TD error to amplitude scaling. Higher values make amplitude more sensitive to TD error magnitude.
Maximum scaling factor for amplitude. Final amplitude =
base_amplitude * scale, where scale is clamped to [1.0, amp_max_scale].Pulse Count Scaling
Gain multiplier for TD error to pulse count scaling. Higher values make pulse count more sensitive to TD error magnitude.
Maximum scaling factor for pulse count. Final pulses =
base_pulses * scale, where scale is clamped to [1.0, pulse_max_scale].Exponential Moving Average
Beta parameter for exponential moving average of TD errors. Used to track baseline TD error magnitude for normalization. Higher values (closer to 1.0) result in slower adaptation.
Unpredictable Stimulation
Some events (like taking damage) can optionally include unpredictable background stimulation to enhance learning through temporal contrast.Whether to add unpredictable background stimulation for this event
Frequency (Hz) for unpredictable background stimulation
Duration in seconds for each unpredictable stimulation burst
Rest period in seconds between unpredictable stimulation bursts
Specific channels to use for unpredictable stimulation. If None, uses the same channels as the main event feedback.
Amplitude (μA) for unpredictable stimulation. If None, uses the base_amplitude value.
Default Event Configurations
ThePPOConfig.event_feedback_settings dictionary contains these default event configurations: