Skip to content

Fixes bug for computing gradient #16

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

Merged
merged 1 commit into from
Jul 22, 2025

Conversation

bear-is-asleep
Copy link

@bear-is-asleep bear-is-asleep commented Jul 16, 2025

Replaces DeepLearnPhysics#96 on DLP

std(x) has a prefactor of 1/N, whereas cov(x,y) has a prefactor of 1/N-1. So we should use the covariance[0,0] to get the variance of x directly.

cov[0,1]/cov[0,0],cov[0,1]/np.std(df['seg_rrs'][ind])**2
>>> (np.float64(0.018677554097208945), np.float64(0.020375516343523768))

std(x) has a prefactor of 1/N, whereas cov(x,y) has a prefactor of 1/N-1. So we should use the covariance[0,0] to get the variance of x directly.

```
cov[0,1]/cov[0,0],cov[0,1]/np.std(df['seg_rrs'][ind])**2
>>> (np.float64(0.018677554097208945), np.float64(0.020375516343523768))
```
@francois-drielsma francois-drielsma merged commit 4ad1b90 into francois-drielsma:develop Jul 22, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants