feat(train): the Keras backend gives a Loss that needs a PRNG key one per step
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- keras, python
- Ambito
- backend-api-design, machine-learning
Direzione di ricerca
Start with packages/pipekit-train/src/pipekit_train/backends/keras/_losses.py, reading bridge_loss, aux_names, and aux_metrics; then check call_loss in packages/pipekit-train/src/pipekit_train/losses/_losses.py and the Keras adapter design sections cited in the issue. Add per-call keys for training, probing, and validation, then run the train-extras tests and the listed lint, format, and type checks. Done means required-key losses train and receive a fresh key each step.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem / Request
The Keras backend (#320) bridges a pipekit_train.Loss into a Keras loss, but a Keras loss is called (y_true, y_pred) with no PRNG key. A Loss whose key argument is required, such as a sample-based divergence, therefore cannot train under backend="keras"; #320 refuses it with an error that names this issue. A Loss whose key defaults to None (KL with an analytic divergence) already trains.
User Story
As someone training an amortized posterior with a sample-based loss, I want
backend="keras"to hand myLossa fresh key each step, as the Equinox backend does, so that the same loss trains under both backends.
Design Snapshot
- Keep a
keras.random.SeedGenerator(loop.seed)in the bridged loss and the auxiliary metrics, and callcall_loss(loss, y_pred, y_true, key=seed_generator.next())inside the traced train step. The Equinox backend splitsjax.random.key(loop.seed)once per step; matching its key sequence exactly is not required, but one key per step and per call is. - The auxiliary-name probe before
compilepasses a fixed key. - Validation passes a key too, so that a stochastic validation metric is defined.
- Remove the refusal added in #320.
References & Existing Code
packages/pipekit-train/src/pipekit_train/backends/keras/_losses.py(bridge_loss,aux_names,aux_metrics)packages/pipekit-train/src/pipekit_train/losses/_losses.py(call_loss,KL)- Design:
packages/pipekit-train/docs/design/keras_adapter.md§8.2 and §10 ("losses that take a key")
Definition of Done
- A
Losswith a requiredkeytrains underbackend="keras" - Tests pass with
train-extras; lint, format and typecheck pass
Testing
- A loss that adds
jax.random.normal(key, ()) * 0trains, and receives a different key each step -
KLwith its sample-based fallback trains on a toy amortized posterior
Relationships
- Parent (theme epic): #317
- Blocked by: #320
- Lingua principale
- Python
- Stelle
- 0
- Fork
- 0
- Merge medio
- 3h 50m
- PR unite (30g)
- 143
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di jejjohnson/pipekit
-
area:code layer:0-primitives priority:p2 type:feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jejjohnson/pipekit#296 ·
I maintainer di solito rispondono entro 1 giorno
-
area:code type:feature
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
jejjohnson/pipekit#411 ·
I maintainer di solito rispondono entro 1 giorno
-
area:code type:feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
jejjohnson/pipekit#410 ·
I maintainer di solito rispondono entro 1 giorno
-
area:code type:feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
jejjohnson/pipekit#409 ·
I maintainer di solito rispondono entro 1 giorno
-
area:code type:feature
Difficoltà 3/5 1-2 giorni Idoneità per principianti 75/100
jejjohnson/pipekit#408 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di jejjohnson/pipekit
Issue simili
-
A JSON chat answer blocks the backend event loop for the whole RAG runForse già presa @NopeCharon l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
The-OpenROAD-Project/ORAssistant#656 ·
I maintainer di solito rispondono entro 1 giorno
-
bug(operator): VolterraOperator built inside jax.jit with a concrete decay raises TracerBoolConversionErrorForse già presa @jejjohnson l’ha presa oggi. Apertatype:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
jejjohnson/integrix#144 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
finos/ai-governance-framework#459 ·
-
slurm: a case outcome nested too deep crashes status/collect instead of reading as no outcomeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
autowarefoundation/autoware_carla_scenario#2963 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno