Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Rewrite StandardScaler in terms of equistore operations #18

Open
Luthaf opened this issue Feb 23, 2023 · 3 comments
Open

Rewrite StandardScaler in terms of equistore operations #18

Luthaf opened this issue Feb 23, 2023 · 3 comments

Comments

@Luthaf
Copy link
Collaborator

Luthaf commented Feb 23, 2023

StandardScaler should be implemented in term of equistore.mean, equistore.std, … Right now, it contains a manual re-implementation of these operations.

See #15 (comment)

@agoscinski
Copy link
Collaborator

Maybe it is actually useful to use the mean_over_samples and variance_over_samples function here.

Originally posted by @PicoCentauri in #15 (comment)

@PicoCentauri
Copy link
Collaborator

I was looking into this and since we are using a weighted mean we first have to add an equistore.average_over_samples function with a weight option - similar to numpy.average. Currently we only have a classical mean. Pinging also @DavideTisi here :-)

@agoscinski
Copy link
Collaborator

I think we should standardize the features and gradients more consistently. At the moment in the standardization we divide by two different terms. One we get from the standard deviation of the values and the other from the standard deviation of the gradients, but we should use both times the standard deviation of the values to be consistent. (My bad, I implemented this)

$$\hat{a} = \frac{a}{\sigma}$$

$$ \frac{\partial\hat{a}}{\partial x} = \frac{\partial a}{\partial x} \frac1{\sigma} $$

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants