-
Notifications
You must be signed in to change notification settings - Fork 179
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
Proposal for clarifying vocabs #789
Comments
In general: 👍 |
Hmmmm. Would it still throw an error if the modules are of the same dimensionality? |
Also, it's not clear what this should do:
Should it fail? (Because both the vocabularies are different)
What should that do? (It should be an identity transform, but the |
Other words for transform: (i just looked up the synonyms) change, alter, convert, metamorphose, transfigure, transmute, mutate; revolutionize, overhaul; remodel, reshape, redo, reconstruct, rebuild, reorganize, rearrange, rework, renew, revamp, remake, retool, transmogrify, morph I like morph. 😄 |
I like it! A couple other options for syntax that come to mind: This conversion stuff reminds me a lot of type casting, so something along the lines of That being said, I still like |
Maybe we need another operation for the associative memory which changes the associated vocabulary but without applying any transform (and the dimensionality of input and output vocab have to match in this case)? In C++ casting terms we would have a But I don't like cryptic the C/C++ casting syntax. |
I kinda like the dot syntax. It opens up the possibility to do this:
i.e. convolve |
I'd very much prefer if we kept with only two cases: are the vocabs the same or are they different. I think things get nedlessly much more complicated if we handle three cases: are the vocabs the same, are they different but have the same dimensionality, and are they different. |
For subvocabs, I'm completely not sure. My instinct is that a subvocab is just the same as the normal vocab, but with a subset of the terms, so we should just treat it as matching as far as this logic is concerned. That way the only things the subvocab does is give a restricted set of terms for display or for |
Oh, and one quick comment for people brainstorming different syntax possibilities: I really really really want it to stay as valid Python syntax. So |
+1 for casting with vocabs |
what do you mean by this? Do you mean the idea in general or do you mean the specific C syntax of |
Sorry, I meant a=a(b*c) |
|
I agree. In regards to the dot format, this: |
|
What about |
Hmmm. I could get on board with that! |
Further thinking about it. |
I could see memory = NOUN * (vision * ~BLUE).convert(memory)
memory = NOUN * memory[vision * ~BLUE]
memory = NOUN * (vision * ~BLUE).memory
memory = NOUN * (vision * ~BLUE).to(memory) |
Ah, one more constraint to add to the syntax. It is sometimes useful to be a little more explicit about the rules of the conversion from one vocab to another. For example, I might want to only consider certain terms, or I might want it to only work for terms that already exist in both vocabs (or in either vocab). So I might want something like memory = NOUN * (vision * ~BLUE).to(memory, terms=[CIRCLE, TRIANGLE]) or memory = NOUN * (vision * ~BLUE).to(memory, require_common_terms=True) That consideration leans me back away from |
the |
memory = NOUN * (vision * ~BLUE).memory looks like an attribute with the name I still like |
Yup, that fits with my thoughts too. Here's a fifth option to consider: memory = NOUN * (vision * ~BLUE).transform_to(memory) It's longer to type, but more readable, I think. And I think it'll be pretty rare for people to do |
(Note: one reason I like |
I don't think it's as rare as you think. 😉 The moment you start messing around with wanting different vocabularies for different parts of your model, which is not uncommon (it's in Spaun, Dan used it in his models, Eric is using it in stuff he's doing at telluride, and even folks at the summer school did this too). |
That said, I'm still okay with |
If it's something that will be used a lot, especially in one line, I'd prefer something shorter like When I see |
I've changed my mind and decided that I also enjoy the .to option, although On Wednesday, July 15, 2015, Brent Komer notifications@github.com wrote:
|
I think I like |
I'm also curious to know when this will be used. The reason I ran into problems is that I had a cleanup memory It's not clear to me what is the point of Buffer's having vocabs different from the default vocabs in the model. It seems to me that if everything ran through the default vocabs, then as long as |
I think that is exactly what is being proposed here, that by default there won't be any transform, and everything will have to use the same vocabulary. If the user doesn't want that, they have to be explicit about it (using the syntax discussed above). Unless I'm misunderstanding things. |
@hunse what you're describing there is an issue to do with write-only subvocabularies, which is related to this but not the thing being addressed here. I believe that what would happen with read-only subvocabs is that subvocabularies would be treated as the same vocab, and your example would work fine without a What this proposal is about is the ability to map from one vocab to another completely separate vocab. That's the only situation a |
@hunse's comment made me think, when you do e.g. Edit: wrote the example wrong |
Is there something special about cleanup memory regarding vocabs? My Also, with the new changes being proposed, the plan is to allow the simple One reason for allowing different vocabs might be to allow the usage of PS: I have my vote for transform_to. However, we could even just use change_to On Wed, Jul 15, 2015 at 1:24 PM, Eric Hunsberger notifications@github.com
|
@drasmuss In your example ( |
Yeah I wrote the example wrong at first, it should have been |
@s72sue The issue with cleanup memories is that when you create it, you pass in a vocabulary to use. And if the |
@drasmuss Um. Right now, the |
I very strongly disagree with this. If I have two separate vocabularies |
😵 I don't feel that strongly either way, so happy to be overruled |
The SPA compiler (now merged into |
I skimmed the discussion again and it was mostly about the syntax and naming of stuff I already implemented in the SPA compiler. Of course I forgot about the decisions made here. So this is the naming and syntax I ended up with:
If someone dislikes that, I'm happy to discuss other names (@xchoo seemed to be an favour of
with a little bit effort. |
I like the |
It converts it to the inferred "type"/vocabulary. I hope it's sort of obvious in most cases ... |
As discussed in #784 and as has come up a number of times when using Vocabularies, there is a lot of black magic going on. The particular issue in #784 is that it can be very unclear as to which vocab is being used where when parsing Actions. This proposal is meant to make things more explicit and give the user control over this as needed.
Consider the Effect
memory = vision*~BLUE*NOUN
. This can be interpreted as "take the blue thing I am looking at and store it in memory bound with NOUN". So if vision is currentlyBLUE*SQUARE+RED*TRIANGLE
I should end up withSQUARE*NOUN
stored in memory. If memory and vision have the same Vocabulary, then this is fine. But what happens if they have different vocabularies? Right now, what it does is use vision's vocab for BLUE and NOUN, and then finds a linear transform from vision's vocab to memory's vocab (using thetransform_to
function). In this particular case, it makes sense to look up BLUE in vision's vocab, but it's kind of weird to look up NOUN in vision's vocab, since that's really a memory thing. In #784 there was some discussion of checking to see if vision is marked as a read-only vocab, and if it is a read-only vocab but NOUN doesn't exist in it, then we should try memory's vocab, but we couldn't find a clean set of logic to do this.Instead, let's force people to be explicit when converting between vocabs. This means I would instead write
memory=((vision*~BLUE).convert(memory))*NOUN
. Now we are explicit about BLUE being in vision's vocab and NOUN being in memory's vocab.Notes:
memory=vision
and those use different vocabs, that is now an error. You'd have to domemory=vision.convert(memory)
a=b*c
which can do some pretty wacky transformations when a b and c all have different vocabs. Instead, you'd have to doa=b.convert(a)*c.convert(a)
or possiblya=(b.convert(c)*c).convert(a)
depending on which one you wanted.convert
might be nice. @arvoelke suggestedto
. Any other ideas?Thoughts?
The text was updated successfully, but these errors were encountered: