Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist before merging this PR:
ok).Fixes #3218
Summary
Foundation models return all pretrained quantiles during fine-tuning which is needed for the quantile loss, but
PLForecastingModule._update_metrics()used that output directly for the training metrics. Withlikelihood=Nonethis crashes with a shape mismatch; with a user-selected quantile subset it silently pairs values with the wrong quantile levels.This PR adds a hook to the base module and uses it so that metrics only see the user-selected predictions, just like validation does, while the training loss still uses all pretrained quantiles:
PLForecastingModule._metrics_prediction(output): new hook, returnsoutput.predictionby default._update_metrics()now calls it. Behaviour is unchanged for all other models._TiRexModule._metrics_prediction(): during fine-tuning, selects the user quantiles (the median iflikelihood=None) from the all-quantile training output.Work in progress:
TiRex2Model,Chronos2Model,TimesFM2p5Model,TimesFM3Model,PatchTSTFMModel.likelihoodcurrently says it only affects prediction output.Other Information
Question:
T0Modelsupports arbitrary quantile levels at prediction time through interpolation, whereas its training output only contains its fixed pretrained quantiles. This means the requested quantiles cannot always be selected directly from the training output. How should this case be handled when computing training metrics?