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

Non-homogenous Vectorization #1486

Closed
pgkirsch opened this issue Apr 21, 2020 · 3 comments
Closed

Non-homogenous Vectorization #1486

pgkirsch opened this issue Apr 21, 2020 · 3 comments

Comments

@pgkirsch
Copy link
Contributor

Related to #1465:

Is there an elegant way to enable the following concept of vectorization with GPkit:

with Vectorize(4): 
   self.HLM = HighLevelModels()
    with Vectorize([2, 3, 1, 1]):
        self.MLM = MidLevelModels()
        with Vectorize(2):
            self.LLM = LowLevelModels()

where the length of the middle level of vectorization must necessarily be equal to the degree of the top level of vectorization.

I'm trying to figure out an elegant way of allowing the 7 parallel mid-level models to share common parents. So in this example, the first two models share the same high-level model, models 3-5 share the same high-level model, and so forth.

Ultimately the lowest level variables in this example should have shape (4,7,2).

Any suggestions?

@1ozturkbe
Copy link
Contributor

Alright, I toyed with some ideas just now, and none of them were elegant.

@1ozturkbe
Copy link
Contributor

I think this is most elegant when there is a mapping... will post in a little bit, need breakfast.

@1ozturkbe
Copy link
Contributor

1ozturkbe commented Apr 22, 2020

I don't have time to do this, but I think you could do a sequential mapping, where you generate LLMs, MLMs and HLMs with indices [x,y,z], [x,y] and [x], and recursively nest them as arguments to each other. This way you can generate arbitrary shapes of vectored models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants