Skip to content

Commit 3a6b202

Browse files
authored
Merge pull request #996 from jdb78/fix/identity-encoder
Fix centering
2 parents 9e75685 + 8369d8d commit 3a6b202

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_forecasting/data/encoders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ def _set_parameters(
498498
q_75 = np.percentile(y_scale, 75)
499499
q_25 = np.percentile(y_scale, 25)
500500
self.scale_ = (q_75 - q_25) / 2.0 + eps
501-
if not self.center:
501+
if not self.center and self.method != "identity":
502502
self.scale_ = self.center_
503503
if isinstance(y_center, torch.Tensor):
504504
self.center_ = torch.zeros_like(self.center_)

0 commit comments

Comments
 (0)