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

tf -> scipy #198

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

Conversation

aditya-sengupta
Copy link

  • Takes out dependency on tensorflow, makes eleanor compatible with Python 3.8
  • Refactors targetdata.py:psf_lightcurve and expands functionality of models.py

@benmontet
Copy link
Collaborator

Hey, awesome! Let me play with it a little bit and try to break it, and assuming I can't I'll merge it in.

Have you done any benchmarking? How does the speed compare to the tf implementation?

@codecov
Copy link

codecov bot commented Sep 22, 2020

Codecov Report

Merging #198 into master will increase coverage by 2.30%.
The diff coverage is 7.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #198      +/-   ##
==========================================
+ Coverage   46.15%   48.45%   +2.30%     
==========================================
  Files          20       20              
  Lines        2247     2132     -115     
==========================================
- Hits         1037     1033       -4     
+ Misses       1210     1099     -111     
Impacted Files Coverage Δ
eleanor/models.py 0.00% <0.00%> (ø)
eleanor/targetdata.py 53.92% <7.31%> (+4.88%) ⬆️
eleanor/source.py 49.59% <75.00%> (+0.20%) ⬆️
eleanor/mast.py 88.29% <100.00%> (ø)
eleanor/visualize.py 13.79% <0.00%> (+1.97%) ⬆️
eleanor/update.py 84.18% <0.00%> (+5.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2090bc7...d0eac4b. Read the comment docs.

@aditya-sengupta
Copy link
Author

Detailed this in an email just now: speed seems about comparable/maybe a little bit slower than tf (unclear how specific to my machine this is). This can be sped up by model updates/the Pytorch upgrade that aren't in this PR but should hopefully be coming soon!

@benmontet
Copy link
Collaborator

Hey,

The code looks great! I really appreciate your efforts here.

In testing I'm running in to some issues which are probably due to issues around the initialisation of parameters. I want to make sure the results look the same on your end and my end which will help isolate where the issue is and how to sort it. Can you send me the output of the following from your end?

> star = eleanor.Source(tic=38846515, sector=1)
> data = eleanor.TargetData(star, do_psf=True)
> q = data.quality == 0
> plt.plot(data.time[q], data.psf_flux[q], '.')

I see the following, which is very much not what the star is doing in reality! I'm reasonably confident this is an issue with the initialisation of parameters, with a bad initial guess leading to the minimiser finding a local rather than the global minimum.

Assuming you see the same thing I'll try to trace it through to see if I can find more flexibly sensible starting conditions and I have a feeling everything will go fine from there.

image

@aditya-sengupta
Copy link
Author

aditya-sengupta commented Sep 29, 2020 via email

@aditya-sengupta
Copy link
Author

Resolved the aforementioned unit issue

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