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

How do I get the constraints of a paramz array? #29

Open
yenicelik opened this issue Sep 20, 2018 · 3 comments
Open

How do I get the constraints of a paramz array? #29

yenicelik opened this issue Sep 20, 2018 · 3 comments

Comments

@yenicelik
Copy link

I have the model.param_array. Is there something equivalent for the constraints?

@mzwiessele
Copy link
Member

mzwiessele commented Sep 20, 2018 via email

@yenicelik
Copy link
Author

yenicelik commented Sep 20, 2018

Thanks! However, when I do the following:

Class definition

    class ExampleClass(Parameterized):
        def __init__(self):
            self.param1 = Param("param1", np.asarray([5.]))
    algorithm = ExampleClass() # Inherits from Parameterized
    print(algorithm.constraints) # output 1
    print(algorithm.param1.constraints) # output 2

Gives the following output (which is a bit cryptic for me)

Output 1:

{Logistic: array([0]),
 Logistic: array([1]),
 Logistic: array([2]),
 'fixed': array([], dtype=int64)}

Output 2.

{Logistic: array([0])}

@yenicelik yenicelik reopened this Sep 20, 2018
@mzwiessele
Copy link
Member

mzwiessele commented Sep 21, 2018 via email

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

No branches or pull requests

2 participants