Lightning-AI / Lightning-AI/pytorch-lightning

Allow epochs with different size

Open
#21,773 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature waiting on author
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

### Description & Motivation

Currently there is no support for epochs of different lengths.
The reason is for example what if I want use augmentation that makes dataset shorter.

For example my usacase is to offset timeseries data in each epoch differently.

### Pitch

For timeseries data it would be very useful if logging didnt break, when there are epochs of different lengths.

So far logging completely breaks when u dynamically change epoch length.

### Alternatives

Sure i could make it work by merging everything into one epoch. But that would disallow me to use on-epoch hooks, which I want to utilize.

So far Iam going to inspect logging logic, because it seems there is an issue. Or hook trigger logic, since so far iam not sure if hooks even trigger for epoch end.

### Additional context

_No response_

cc @lantiga

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 by inspecting the logging logic and hook trigger logic, as suggested in the issue, and reproduce training with dynamically changing epoch lengths. Check whether logging breaks and whether end-of-epoch hooks trigger correctly when epochs differ in size. Done means variable-length epochs no longer break logging while preserving the requested on-epoch hooks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.