Skip to content

Trainer reuses the same data permutation every epoch #9

Description

@Daniel-B-McBride

The trainer creates the shuffle key once, outside the epoch loop:

key, subkey1, subkey2 = jax.random.split(key, 3)

for epoch in range(train_epochs + 1):
    for x, y in iterate_dataset(
        train_ds,
        nbatches,
        batch_size,
        subkey1,
        True,
    ):

Since JAX PRNG keys are immutable, subkey1 produces the same permutation every epoch.

Expected behavior is to generate a fresh training key each epoch, e.g.

for epoch in range(train_epochs):
    key, train_key = jax.random.split(key)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions