feat(train): CatalogDataset, a dataset that reads a geocatalog query

Open
#186 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

Start with packages/pipekit-train/src/pipekit_train/dataset.py and TrainingDataset/hash_config, then verify the geocatalog and geopatcher APIs and how the [catalog] extra resolves at the intended pin. Implement and export CatalogDataset only after the design is settled; done means its sampler and preprocessing match the hand-run results, its hash changes for each listed input, and make test, lint, typecheck, and docs reconciliation pass.

Written by the indexing model from the issue text.

Description

area:code priority:p2 type:feature

Problem / Request

Add CatalogDataset, a training dataset that reads rows from a geocatalog query or patches from a geopatcher sampler, and hashes everything that determines its contents.

User Story

As a user training on labelled scenes, I want the dataset to read a catalog through the same preprocessing as inference, so that training and serving can't drift apart.

Motivation

pipekit-train ships SimulationDataset, CachedDataset and IterableDataset, but nothing for the direct-supervised shape, where inputs and labels come from a catalog.
docs/design/api/datasets.md and docs/design/examples/direct.md already specify it, and CatalogDataset doesn't exist at 3b9582d.

Proposed API

# Shapes: chips (N_batch, 4, 256, 256) → labels (N_batch, 2, 256, 256)
# proposed (this issue)
dataset = pt.CatalogDataset(
    catalog=gc.open_catalog("s3://imeo/labeled-scenes.parquet"),   # not pinned (geocatalog)
    preprocess=preprocess_op,                                      # the inference preprocess
    target_op=load_label,                                          # user
    sampler=gp.RegularStride((256, 256)),                          # not pinned (geopatcher)
)
  • It iterates the rows a query returns, or the patches a sampler cuts from them.
  • preprocess is the same operator the inference pipeline runs.
  • content_hash covers the catalog's own hash, the query, the sampler config, the preprocess config, the split and the seed.
  • With geocatalog's state profile, the same class reads a state catalog, so there is no separate state-catalog type (unverified at this pin).

Design Snapshot

This needs its own design pass before coding, because it crosses into geocatalog and geopatcher.
The geocatalog API above hasn't been checked at this pin.
pyproject.toml says the catalog extra lands once geocatalog publishes to PyPI, so settle how the dependency resolves first.

References & Existing Code

  • geostack docs/reports/11_pipekit_train.md, workstream A1 and gate A1.
  • TrainingDataset and hash_config in packages/pipekit-train/src/pipekit_train/dataset.py @ 3b9582d.

Implementation Steps

  • Confirm the geocatalog and geopatcher APIs, and how the [catalog] extra resolves.
  • Add CatalogDataset in pipekit_train/dataset.py and export it.
  • Add the [catalog] extra.

Definition of Done

  • Code lands at the intended path.
  • Tests pass: make test.
  • Lint + typecheck pass: make lint && make typecheck.
  • Docstrings (Google-style) on all public symbols.

Testing

  • On a 10-scene catalog with RegularStride((256, 256)), it yields the same chips, to 0, as running the sampler and preprocess by hand.
  • Its hash changes when any of query, sampler, preprocess, split or seed changes.

Documentation

  • Reconcile docs/design/api/datasets.md and docs/design/examples/direct.md with what ships.

Relationships

  • Parent (theme epic): #145
Dominant language
Python
Stars
0
Forks
0
Avg merge
3h 50m
Merged PRs (30d)
143

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jejjohnson/pipekit

All issues in jejjohnson/pipekit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.