Skip to content
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

Dividing by zero when doing normalisation to prepare for Gridsearch #411

Open
young-x-skyee opened this issue Nov 21, 2024 · 1 comment
Open
Assignees
Labels
🪲 bug Something isn't working gridsearch Related to the gridsearch

Comments

@young-x-skyee
Copy link
Contributor

young-x-skyee commented Nov 21, 2024

It seems that the problem of dividing by zero when doing normalisation for a constant signal in one second is not fixed in the main branch, but is already fixed in the language branch by using

def normalize(x: NDArray, eps: float = 1e-7) -> NDArray:
    """
    Remove the mean and divide by the Euclidean magnitude.
    """
    x -= np.mean(x, axis=-1, keepdims=True)
    x /= np.sqrt(np.sum(x**2, axis=-1, keepdims=True)) + eps
    return x

Maybe similar changes should be made to main as well?

@young-x-skyee young-x-skyee added 🪲 bug Something isn't working gridsearch Related to the gridsearch labels Nov 21, 2024
@neukym
Copy link
Member

neukym commented Nov 21, 2024

Cai, I asked Tianyi to add this in as an issue because I wasn't sure whether the language branch was doing it in the same way as your fix - can you have a check and if it's already sorted in the main branch then we can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working gridsearch Related to the gridsearch
Projects
None yet
Development

No branches or pull requests

3 participants