probml / probml/dynamax

modify SGD training to avoid using generators

Open
#256 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
Python
Stars
1k
Forks
114
Avg merge
19h 14m
Merged PRs (30d)
1

Description

Currently, run_sgd uses generators to create a stream of minibatches, but this causes issues with jit. It may be better to refactor the code to work in terms of epochs, and then shuffle at the start, similar to this flax mnist example

Contributor guide

Open the contributing guide

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.

Research direction

Start in dynamax/utils/optimize.py at run_sgd, then compare the epoch-based structure and shuffling approach in the linked Flax MNIST example. The refactor is complete when minibatch handling no longer uses generators and the SGD training flow is compatible with jit while preserving epoch-level shuffling.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.