Neural Simulator OpenAI Gym Bridge
Scanned 9/11/2026
Install to Claude Code
npx -y skills add hiyenwong/ai_collection --skill neural-simulator-openai-gym-bridge --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Neural Simulator Openai Gym Bridge?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hiyenwong-neural-simulator-openai-gym-bridge)More formats (shields.io, HTML) on the badges page.
---
name: neural-simulator-openai-gym-bridge
arxiv_id: 1709.05650v1
utility: 0.88
tags: '[NEST, OpenAI Gym, reinforcement learning, actor-critic, SNN, simulator, RL benchmark]'
created: 2026-03-31
description: "Neural Simulator OpenAI Gym Bridge"
---
# Neural Simulator OpenAI Gym Bridge
## Activation Keywords
- NEST OpenAI Gym
- 神经网络仿真器强化学习
- SNN reinforcement learning
- actor-critic SNN
- biologically plausible RL
- neural simulator benchmark
## Problem Statement
计算神经科学与机器学习的结合面临挑战:
- 神经网络仿真器(NEST, Brian 等)与 RL 环境隔离
- 自定义仿真脚本难以复现
- 不同学习架构难以比较
## Method Overview
Jordan et al. (2017) 提出了神经网络仿真器与 OpenAI Gym 的桥接方案:
1. 连接 NEST 仿真器与 OpenAI Gym
2. 标准化环境评估
3. 生物合理的 actor-critic 架构
4. 跨领域工具链复用
## Tools Used
- `Component` - Analysis component
- `NEST Simulator` - Analysis component
- `OpenAI Gym` - Analysis component
- `Bridge Layer` - Analysis component
- `Actor-Critic` - Analysis component
## Architecture
```
OpenAI Gym Environment
↓
Observation Space
↓
┌─────────────────────┐
│ NEST Simulator │
│ ┌───────┬───────┐ │
│ │ Actor │ Critic│ │
│ └───────┴───────┘ │
│ Spiking Network │
└─────────────────────┘
↓
Action Output
↓
Environment Update
```
## Step-by-Step Instructions
### 实现 NEST-Gym 桥接
1. **环境配置**
```python
import gym
import nest
# 创建 Gym 环境
env = gym.make('CartPole-v1')
# 配置 NEST 仿真器
nest.SetKernelStatus({'local_num_threads': 4})
```
2. **观察空间编码**
```python
def encode_observation(obs, n_neurons=100):
"""将连续观察编码为 spike 模式"""
# Population coding
rates = rate_coding(obs, n_neurons)
spike_generators = nest.Create('poisson_generator', n_neurons)
nest.SetStatus(spike_generators, 'rate', rates)
return spike_generators
```
3. **Actor-Critic SNN 实现**
```python
def create_actor_critic(n_inputs, n_actions):
"""创建 actor-critic SNN"""
# Actor: 策略网络
actor = nest.Create('iaf_psc_alpha', n_actions)
# Critic: 价值网络
critic = nest.Create('iaf_psc_alpha', 1)
# 输入层
input_layer = nest.Create('poisson_generator', n_inputs)
# 连接(使用 STDP)
nest.Connect(input_layer, actor,
syn_spec={'weight': np.random.randn(n_inputs, n_actions)})
return actor, critic
```
4. **动作解码**
```python
def decode_action(actor_neurons, dt=100.0):
"""从 spike 模式解码动作"""
spike_counts = nest.GetStatus(actor_neurons, 'n_events')
return np.argmax(spike_counts)
```
5. **训练循环**
```python
def train_snn_rl(env, n_episodes=1000):
for episode in range(n_episodes):
obs = env.reset()
spikes = encode_observation(obs)
while True:
# 仿真一步
nest.Simulate(dt)
# 解码动作
action = decode_action(actor)
# 环境交互
obs, reward, done, _ = env.step(action)
# 更新权重(STDP + reward modulation)
apply_reward_modulation(reward)
if done:
break
```
## Example Usage
```python
from nest_rl_bridge import NestGymBridge
# 创建桥接
bridge = NestGymBridge(
env_name='CartPole-v1',
n_input_neurons=100,
n_output_neurons=2,
dt=1.0 # simulation timestep (ms)
)
# 训练
bridge.train(n_episodes=500, learning_rate=0.01)
# 评估
mean_reward = bridge.evaluate(n_episodes=100)
print(f"Mean reward: {mean_reward}")
```
## Key Benefits
| Aspect | Custom Scripts | NEST-Gym Bridge |
|--------|----------------|-----------------|
| Reproducibility | Low | High |
| Benchmarking | Difficult | Standardized |
| Comparison | Hard | Easy |
| Bio-plausibility | Varies | High |
## Description
Neural Simulator OpenAI Gym Bridge
**Key Concepts:**
- 计算神经科学与机器学习的结合面临挑战:
- 神经网络仿真器(NEST, Brian 等)与 RL 环境隔离
- 自定义仿真脚本难以复现
- 不同学习架构难以比较
## Instructions for Agents
Follow these steps when applying this skill:
### Step 1: 环境配置
### Step 2: 观察空间编码
### Step 3: Actor-Critic SNN 实现
### Step 4: 动作解码
### Step 5: 训练循环
## Examples
### Example 1: Basic Application
**User:** I need to apply Neural Simulator OpenAI Gym Bridge to my analysis.
**Agent:** I'll help you apply neural-simulator-openai-gym-bridge. First, let me understand your specific use case...
**Context:** 计算神经科学与机器学习的结合面临挑战:
- 神经网络仿真器(NEST, Brian 等)与 RL 环境隔离
- 自定义仿真脚本难以复现
- 不同学习架构难以比较
### Example 2: Advanced Scenario
**User:** Complex analysis scenario
**Agent:** Based on the methodology, I'll guide you through the advanced application...
### Example 2: Advanced Application
**User:** What are the key considerations for neural-simulator-openai-gym-bridge?
**Agent:** Let me search for the latest research and best practices...
## References
- Jordan, J. et al. (2017). Closing the loop between neural network simulators and the OpenAI Gym. arXiv:1709.05650.
## Related Skills
- snn-simulation-tools-review
- spikingjelly-framework
- decolle-snn-learningIs this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!