question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't instantiate priors

See original GitHub issue

Many priors from ‘GPy.priors’ don’t work at all:

In [2]: GPy.priors.Uniform()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-157dba2fded5> in <module>()
----> 1 GPy.priors.Uniform()

/home/aplavin/anaconda3/lib/python3.6/site-packages/GPy/core/parameterization/priors.py in __new__(cls, lower, upper)
    102                 if instance().lower == lower and instance().upper == upper:
    103                     return instance()
--> 104         o = super(Prior, cls).__new__(cls, lower, upper)
    105         cls._instances.append(weakref.ref(o))
    106         return cls._instances[-1]()

TypeError: object() takes no parameters
In [3]: GPy.priors.Uniform(0, 1)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-33389462e27b> in <module>()
----> 1 GPy.priors.Uniform(0, 1)

/home/aplavin/anaconda3/lib/python3.6/site-packages/GPy/core/parameterization/priors.py in __new__(cls, lower, upper)
    102                 if instance().lower == lower and instance().upper == upper:
    103                     return instance()
--> 104         o = super(Prior, cls).__new__(cls, lower, upper)
    105         cls._instances.append(weakref.ref(o))
    106         return cls._instances[-1]()

TypeError: object() takes no parameters

same issue with Exponential. On the other hand, some priors do work:

In [5]: GPy.priors.Gamma(1, 2)
Out[5]: Ga(1, 2)

but only with explicitly specified parameters, otherwise:

In [3]: GPy.priors.Uniform(0, 1)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-33389462e27b> in <module>()
----> 1 GPy.priors.Uniform(0, 1)

/home/aplavin/anaconda3/lib/python3.6/site-packages/GPy/core/parameterization/priors.py in __new__(cls, lower, upper)
    102                 if instance().lower == lower and instance().upper == upper:
    103                     return instance()
--> 104         o = super(Prior, cls).__new__(cls, lower, upper)
    105         cls._instances.append(weakref.ref(o))
    106         return cls._instances[-1]()

TypeError: object() takes no parameters

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

3reactions
OwenThomascommented, May 9, 2018

Hello,

Another bump for this issue, I am also experiencing it.

0reactions
yeahyelinacommented, Jul 6, 2022

Did anyone solve this problem? I have the exactly same issue. I tried the above one, but it fixed nothing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot instantiate class models.Customer. It must have a ...
When I am using play framework 2.3.5, I met this problem. It seems there is an overriding between the default constructor and the...
Read more >
Cannot instantiate printer for default visualizer #2 - GitHub
When I try to debug CUDA, I get this message: image. Updating VSCode and reinstalling the extension did not solve the problem.
Read more >
I want to understand clearly why can't we instantiate an object ...
It's because an abstract class isn't complete. One or more parts of its public interface are not implemented. You've said what they're going ......
Read more >
Cannot create Azure domain - Microsoft Q&A
Cannot create Azure domain. I tried to add a custom domain to my Pay-As-You-Go Azure account, and it failed with the error:.
Read more >
Bayesian Inference with Prior Information
Supplying prior distributions with some information allows us to fit models that cannot be fit with frequentist methods. (example- all binary outcomes are ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found