Skip to content
Back to skills

Data Collection

ASecurity

"Use Tianshou data carriers, replay buffers, collectors, return

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 9, 2026
datapythongobashdebuggingapi

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill data-collection --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Data Collection?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Data Collection
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-data-collection/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-data-collection)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: data-collection
description: "Use Tianshou data carriers, replay buffers, collectors, return
  batches, and collection statistics safely."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# Data Collection

Use this sub-skill when a task mentions Tianshou `Batch` slicing/merging, `BatchProtocol`, `ReplayBuffer`, `VectorReplayBuffer`, `PrioritizedReplayBuffer`, `HERReplayBuffer`, `Collector.collect`, `AsyncCollector`, n-step return inputs, collection hooks, `CollectStats`, `InfoStats`, `SequenceSummaryStats`, or `MalformedBufferError`.

## Route First

- For trainer loops, epoch orchestration, `Experiment.run`, or how collectors are scheduled during learning, route to `../procedural-training/SKILL.md`.
- For `DummyVectorEnv`, `SubprocVectorEnv`, worker choices, async vectorization, EnvPool, or environment construction details, route to `../envs-and-vectorization/SKILL.md`.
- For offline datasets, offline-only algorithms, imitation-learning workflows, or specialized offline RL choices, route to `../offline-and-specialized-rl/SKILL.md`.

## Read These

- `references/api-reference.md` for object contracts, required keys, buffer variants, stats classes, and key signatures.
- `references/workflows.md` for practical recipes: shaping batches, adding/sampling buffers, collecting by step or episode, hooks, and validation.
- `references/troubleshooting.md` for common shape, null, NaN, malformed-buffer, and collector reset failures.
- `scripts/check_batch_buffer_collector.py` for a safe local smoke check of `Batch`, `ReplayBuffer`, and a minimal collector.

## Fast Checklist

1. Confirm installed imports with `python skills/tianshou/sub-skills/data-collection/scripts/check_batch_buffer_collector.py --help`.
2. Represent data in `Batch` with consistent first dimensions; nested dictionaries become nested `Batch` objects.
3. Add rollout data to buffers with `obs`, `act`, `rew`, `terminated`, `truncated`, `obs_next`, and `info`; `done` is inferred by the buffer.
4. Use `VectorReplayBuffer(total_size, buffer_num)` whenever collecting from multiple vectorized environments.
5. Call `collector.reset()` or use `collector.collect(..., reset_before_collect=True)` before the first collection.
6. Use `n_episode` rather than `n_step` when an episode-level hook writes fields for whole episodes.

## Smoke Check

Run the bundled script after install/import changes or when debugging a data path:

```bash
python skills/tianshou/sub-skills/data-collection/scripts/check_batch_buffer_collector.py
```

Use `--skip-collector` if only `Batch` and `ReplayBuffer` need validation or optional Gymnasium collection dependencies are unavailable.

Files in this skill

  • SKILL.md2.6 KB
  • references/api-reference.md9.8 KB
  • references/troubleshooting.md8.4 KB
  • references/workflows.md7 KB
  • scripts/check_batch_buffer_collector.py7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.