-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ScaleTensor #96
base: feature/improve_loss_functions
Are you sure you want to change the base?
Add ScaleTensor #96
Conversation
- Allows dynamic setup of scalars - Rework variable_scaler to use it
- Consolidate usage of name - Add subset_by_dim - Add resolve - Resolve ruff issues
- Allow a user to set `add_scalar_{key}`
- scale_by_variable_scaling -> scale
if len(self.scalar) == 0: | ||
return x | ||
|
||
if feature_indices is None: | ||
return x * self.variable_scaling | ||
return x * self.variable_scaling[..., feature_indices] | ||
scalar = self.scalar.get_scalar(x.ndim) | ||
|
||
if feature_indices is None or "variable_scaling" not in self.scalar: | ||
return x * scalar | ||
return x * scalar[..., feature_indices] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the piece of code be in the ScaleTensor class ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wdym? The scalar indexing? I would say it depends on the feature_indices
, so it belongs in the loss function.
ScaleTensor