-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
garch example fails #1491
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
Comments
There's actually two issues at play:
|
Also not sure why the tests pass. |
This is interesting - did I write this example originally? |
Is this related? #1170 I think it might be - because the sample is taking advi normally, and Bound might not be working properly. Any ideas @ColCarroll ? |
I can confirm that changing the sampling to nuts for example makes no difference. |
the stuff in the |
Actually, there are a few funny things going on here -- I haven't touched much of the transform code, but here's what I've got: -- As pointed out, you have to supply |
Can you refactor this a bit then Colin?
I think it's clear what the fix is now.
…On Mon, Dec 12, 2016 at 11:47 PM, Colin ***@***.***> wrote:
Actually, there are a few funny things going on here -- I haven't touched
much of the transform code, but here's what I've got:
-- As pointed out, you have to supply mu= in a few places to get things
running
-- You also have to change all the checks in Bounded to use tt.isinf
instead of np.isinf
-- The example hits Bounded.__init__ with lower = -inf and upper being a
theano tensor, but falls through all three checks (we should change those
transform checks to if...elif...elif...else)
-- the call to self.__dict__.update(locals()) means the "default"
transform is the string "infer"
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1491 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA8DiOGfMsap1psX4F-K9VKPlqGjE_oVks5rHdz2gaJpZM4Kl-gL>
.
--
Peadar Coyle
Skype: springcoilarch
www.twitter.com/springcoil
peadarcoyle.wordpress.com
|
Oy, it is a little more complicated than all that -- I was fooled because |
@twiecki @ColCarroll i think i figured it out. we could check if the type(float) is float or not. Then use np.isinf for the float variable.
is this making any sense? |
if isinstance(upper, tt.TensorVariable):
upperisinf = tt.isinf(upper).eval()
else:
upperisinf = np.isinf(upper)
if isinstance(lower, tt.TensorVariable):
lowerisinf = tt.inf(lower).eval()
else:
lowerisinf = np.isinf(lower)
if not lowerisinf and not upperisinf:
self.transform = transforms.interval(lower, upper)
if default <= lower or default >= upper:
self.testval = 0.5 * (upper + lower)
if not lowerisinf and upperisinf:
self.transform = transforms.lowerbound(lower)
if default <= lower:
self.testval = lower + 1
if lowerisinf and not upperisinf:
self.transform = transforms.upperbound(upper)
if default >= upper:
self.testval = upper - 1 Error: theano.gof.fg.MissingInputError: An input of the graph, used to compute Elemwise{sub,no_inplace}(DimShuffle{x}.0, alpha1), was not provided and not given a value.Use the Theano flag exception_verbosity='high',for more information on this error. |
Is there any code that is actually compiling the theano function. I tried to look for it in the sampling code but coudn't find it. Could anybody help. |
this gist might help clarifying what i am asking. |
@kris-singh The code is not run like python code. Maybe reading a bit on the theano docs clears things up: http://deeplearning.net/software/theano/ |
@twiecki if you could take a look at the gist. you would understand my doubt better. |
@kris-singh I looked at the gist. What output do you expect? |
@twiecki since we get the theano variables lets say var1 and var2 and var3 = var1*var2. theano would have only symbolic variable. we need to supply inputs and then compile the var3 to get its output. where in the pymc3 code is this happening. |
@twiecki something like this import theano.tensor as T
from theano import function
a = T.dscalar('a')
b = T.dscalar('b')
c = a*b
f = function([a.b],c)
f(2,3) |
That all happens in model.py. |
@twiecki and the inputs to the these functions are provided using the sample function right? |
Exactly, in |
any ideas on how to solve this. I am stuck. if use something like this tt.le(default,upper). should the upper values from model.var. or how ??? |
can anybody help |
This is quite a tricky issue. Can we evaluate the tensor as it is passed in? We don't need to do the inference during sampling, only during instantiation. |
Oh, that's what you are doing above with isinf. I think we can do the same with lower and upper, no? |
@twiecki but while doing this with isinf also there is a theano error. The inputs are not provided. So we need to figure out how we are going to provide the input values to these variables. |
Ah, I think if a tensor is passed in we can safely assume that it's not inf. |
@kris-singh I think we just need to remove the checks if a tensor is passed. We will assume that it's not inf and not set a test_val (and not check for its value). Does that make sense? |
yes it does. but who to evaluate the tensor like upper when doinging default >= upper ? |
just not set it.
…On Feb 19, 2017 7:43 AM, "Kris Singh" ***@***.***> wrote:
yes it does. but who to evaluate the tensor like upper when doinging
default >= upper ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1491 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AApJmEfRK2hEUZcqY7YpB0ZnVSPjFV3cks5rd-ShgaJpZM4Kl-gL>
.
|
or better yet use the .tag.test_value
…On Feb 19, 2017 8:31 AM, "Thomas Wiecki" ***@***.***> wrote:
just not set it.
On Feb 19, 2017 7:43 AM, "Kris Singh" ***@***.***> wrote:
> yes it does. but who to evaluate the tensor like upper when doinging
> default >= upper ?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#1491 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AApJmEfRK2hEUZcqY7YpB0ZnVSPjFV3cks5rd-ShgaJpZM4Kl-gL>
> .
>
|
Running examples/garch_example.py fails with error:
Python 3.5.2
pymc3 (3.0rc2)
The text was updated successfully, but these errors were encountered: