Tutorial Testing, New EB tutorial "fast" mode doesn't seem to run
See original GitHub issueHey Rodrigo,
Currently testing your tutorials. FYI version numbers:
theano 1.0.4
starry 1.0.0.dev39+g56020701
pymc3 3.8
The new EB tutorials are awesome and I can’t wait to use them in my research!
I’m trying to use this tutorial for the “fast” method of solving for all the parameters in a system including the map. (I’m applying it to a system where I want to find the possible phase curve of the planet). When I try to build a starry model with reasonable parameters for the system I care about I end up with an error when I try to evaluate the flux, and I’m struggling to parse the error.
Input
p1, t01 = 3.0931514, 2.8554633 + 2457000
p2, t02 = 6.7666719, 0.061385 + 2457000
with pm.Model() as model:
PositiveNormal = pm.Bound(pm.Normal, lower=0.0)
# Primary
A_inc = pm.Normal("A_inc", mu=90, sd=5, testval=90)
A_amp = 1.0
A_r = PositiveNormal("A_r", mu=0.778, sd=0.005, testval=0.778)
A_m = PositiveNormal("A_m", mu=0.81, sd=0.03, testval=0.81)
A_prot = PositiveNormal("A_prot", mu=10, sd=10, testval=10)
pri = starry.Primary(
starry.Map(ydeg=5, udeg=2, inc=A_inc, amp=A_amp),
r=A_r,
m=A_m,
prot=A_prot,
)
pri.map[1] = 0.6278
pri.map[2] = 0.1045
# Secondary
B_inc = pm.Normal("B_inc", mu=85.05, sd=0.09, testval=85.05)
B_amp = PositiveNormal('B_amp', mu=0.0001, sd=0.001, testval=0.0001)
B_r = PositiveNormal("B_r", mu=0.01883983, sd=0.0005, testval=0.01883983)
B_m = PositiveNormal("B_m", mu=1, sd=0.1, testval=1)
B_porb = PositiveNormal("B_porb", mu=p1, sd=0.01, testval=p1)
B_prot = B_porb
B_t0 = pm.Normal("B_t0", mu=t01, sd=0.0001, testval=t01)
sec = starry.Secondary(
starry.Map(ydeg=2, udeg=0, inc=B_inc, amp=B_amp),
r=B_r,
m=B_m,
porb=B_porb,
prot=B_prot,
t0=B_t0,
inc=B_inc,
)
# System
sys = starry.System(pri, sec)
sys.flux(0).eval()
Error
MissingInputError: Input 0 of the graph (indices start from 0), used to compute Elemwise{exp,no_inplace}(B_r_lowerbound__), was not provided and not given a value. Use the Theano flag exception_verbosity='high', for more information on this error.
I also get the same error when I try to run the full example from the docs:
Input
map = starry.Map(ydeg=5)
map.add_spot(amp=-0.075, sigma=0.1, lat=0, lon=-30)
A_y = np.array(map.y[1:])
map.reset()
map.add_spot(amp=-0.075, sigma=0.1, lat=-30, lon=60)
B_y = np.array(map.y[1:])
A = dict(
ydeg=5, # degree of the map
udeg=2, # degree of the limb darkening
inc=80.0, # inclination in degrees
amp=1.0, # amplitude (a value prop. to luminosity)
r=1.0, # radius in R_sun
m=1.0, # mass in M_sun
prot=1.25, # rotational period in days
u=[0.40, 0.25], # limb darkening coefficients
y=A_y, # the spherical harmonic coefficients
)
B = dict(
ydeg=5, # degree of the map
udeg=2, # degree of the limb darkening
inc=80.0, # inclination in degrees
amp=0.1, # amplitude (a value prop. to luminosity)
r=0.7, # radius in R_sun
m=0.7, # mass in M_sun
porb=1.00, # orbital period in days
prot=0.625, # rotational period in days
t0=0.15, # reference time in days (when it transits A)
u=[0.20, 0.05], # limb darkening coefficients
y=B_y, # the spherical harmonic coefficients
)
t = np.linspace(-2.5, 2.5, 1000)
flux_true = sys.flux(t)
sigma = 0.0005
flux = flux_true + sigma * np.random.randn(len(t))
with pm.Model() as model:
PositiveNormal = pm.Bound(pm.Normal, lower=0.0)
# Primary
A_inc = pm.Normal("A_inc", mu=80, sd=5, testval=80)
A_amp = 1.0
A_r = PositiveNormal("A_r", mu=0.95, sd=0.1, testval=0.95)
A_m = PositiveNormal("A_m", mu=1.05, sd=0.1, testval=1.05)
A_prot = PositiveNormal("A_prot", mu=1.25, sd=0.01, testval=1.25)
pri = starry.Primary(
starry.Map(ydeg=A["ydeg"], udeg=A["udeg"], inc=A_inc, amp=A_amp),
r=A_r,
m=A_m,
prot=A_prot,
)
pri.map[1] = A["u"][0]
pri.map[2] = A["u"][1]
# Secondary
B_inc = pm.Normal("B_inc", mu=80, sd=5, testval=80)
B_amp = 0.1
B_r = PositiveNormal("B_r", mu=0.75, sd=0.1, testval=0.75)
B_m = PositiveNormal("B_m", mu=0.70, sd=0.1, testval=0.70)
B_prot = PositiveNormal("B_prot", mu=0.625, sd=0.01, testval=0.625)
B_porb = PositiveNormal("B_porb", mu=1.01, sd=0.01, testval=1.01)
B_t0 = pm.Normal("B_t0", mu=0.15, sd=0.001, testval=0.15)
sec = starry.Secondary(
starry.Map(ydeg=B["ydeg"], udeg=B["udeg"], inc=B_inc, amp=B_amp),
r=B_r,
m=B_m,
porb=B_porb,
prot=B_prot,
t0=B_t0,
inc=B_inc,
)
sec.map[1] = B["u"][0]
sec.map[2] = B["u"][1]
# System
sys = starry.System(pri, sec)
sys.flux(t).eval()
Error
MissingInputError: Input 0 of the graph (indices start from 0), used to compute Elemwise{exp,no_inplace}(B_r_lowerbound__), was not provided and not given a value. Use the Theano flag exception_verbosity='high', for more information on this error.
Issue Analytics
- State:
- Created 4 years ago
- Comments:17 (10 by maintainers)
Top Results From Across the Web
Jest Testing Tutorial: 5 Easy Steps - Testim Blog
This Jest tutorial focuses on the Jest testing basics and vocabulary. Moreover, let's learn about Jest snapshot testing for frontend apps.
Read more >Run unit tests with Test Explorer - Visual Studio (Windows)
Learn how to run tests with Test Explorer in Visual Studio. This topic covers how to enable automatic test runs after build, view...
Read more >How To Test a React App with Jest and React Testing Library
Next, open a new terminal and launch the tests with the following command: npm test.
Read more >Getting Started With Testing in Python
In this in-depth tutorial, you'll see how to create Python unit tests, execute them, and find the bugs before your users do. You'll...
Read more >Django Tutorial Part 10: Testing a Django web application
Automated tests can really help with this problem! The obvious benefits are that they can be run much faster than manual tests, can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh I see! I think I was confused because in previous iterations the star luminosity was fixed at “1”, now that the star can change I see that relative brightnesses are fine. Ok excellent, I’ll keep digging!
Hi the original issue is solved, and setting cores to 1 does seem to stop the MCMC getting stuck. 👍