Skip to content

RMS formula mistake? #102

@ejin-photonium

Description

@ejin-photonium

RMS = $\sqrt{\text{mean}\left(\sum x_i^2\right)}$, not $\text{mean}\left(\sqrt{\sum x_i^2}\right).$ However, it seems that in various places in DeepLens code we use the wrong definition of RMS

example: analysis_spot() in geolens.py

  spot_rms = ((ray_xy_norm**2).sum(-1).sqrt() * ray.is_valid).sum(-1) / (
      ray.is_valid.sum(-1) + EPSILON
  )

I think should be

  spot_rms = torch.sqrt(
      ((ray_xy_norm**2).sum(-1) * ray.is_valid).sum(-1) / (ray.is_valid.sum(-1) + EPSILON)
  )

other places this occur include geolens_pkg/optim.py in autolens, and 2_autolens_rms.py and Autolens_rms tutorial notebook

Pls let me know if you agree and I can submit a PR fixing it. I think the RMS calculation for loss and training is still correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions