-
Notifications
You must be signed in to change notification settings - Fork 174
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
Assoc mem v2 #797
Assoc mem v2 #797
Conversation
Flag to indicate if the entire associative memory module is | ||
inhibitable (entire thing can be shut off). | ||
|
||
threshold_output: boolean, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parameter does not appear in the argument list.
I looked over this. The two major issues:
Also added a few minor comments. I could probably fix most of this myself if we agree on above issues. Would be nice to get this merged soon for other PRs related to the associative memory. |
I'm using these for a thesis model so I figured I'd use the most recent version. I cleaned up the code and history a bit and removed the code duplication that @jgosmann mentioned; see my I find the If I happen to realize this and then add a new output, then I've actually created a weird set of interactions such that the both sets of inputs are associated with both sets of outputs. Again, I see the usefulness of this, but I think that the API does not give the correct mental model of what's going on inside the associative memory. When you create it, it sets up an immutable mapping from input vectors to output vectors -- yet, we allow you to add new inputs and outputs. In actuality, what you're adding aren't new inputs and output, but new associations between a new input source and existing outputs, and new associations between existing inputs and a new output source. I need to think more to come up with a more concrete way to express this, but I think we're missing some explanatory abstraction here. |
Oh... Yeah. The They could be renamed to @jgosmann Regarding the 1.5 inhibitory scale, it is possible to change the scale (well, effective scale). All you have to do is put a scale when you connect to the |
I know, why the 1.5 inhibitory scaling is necessary. What I am worried about is that if someone wants a specific scaling they have to either look into the source code or do it by trial and error. Also, it seems plausible to assume that the inhibitory connection has a scale of 1.0 like all unscaled connections. But it requires the user to be aware that they have to add the 1.5 scale on their connections which might be forgotton? I could also see an argument to use a scaling constant (i.e. 1.5) to just make it work without further scaling supplied by the user. But I feel in that case the scaling should be better documented. |
77f0640
to
ed0f07a
Compare
@jgosmann are you okay with keeping the function names in light of the new documentation? How do people feel about adding the inhibition_scale as a parameter? So if you don't want the associative memory to be inhibitable, you just set it to 0, but otherwise it's defaulted to 1.5? Alternatively, if everyone involved in this discussion is willing to put their foot down, I'm fine with documenting the value of 1.5. After that's been decided I can update @ikajic's examples for the new code. I'd like to get this code into a state where it can be merged as need it for a model I'm building. Since that makes a total of three people using it regularly, I think that's a good reason for it to be merged. |
I'm not a fan of having the 'set |
As an aside, the labels for the spa.Associative memory ensembles should be set more intutively. |
Can you remind me about which function names we are speaking?
Don't like it. It is more an issue of what should the default value be and documentation. |
@jgosmann the function names are I'm with Jan's original proposition that the default value should be 1.0 and that if someone isn't seeing the inhibition they want they up the gain. I consider this a nicer scenario then seeing the inhibition they don't want and having to dig through the source code to figure out where the gain on the connection is being mucked with. |
Not sure if I am missing any more recent documentation changes, but to me neither the function names nor the documentation make clear to me what exactly the functions do. Would |
I'm not sure what you mean by 'seeing inhibition they don't want'. If they don't want inhibition, then they should not enable the inhibitory flag. Otherwise, there will be inhibition included. And if they do see inhibition, it doesn't matter if the initial gain is set to 1, or to 1.5. In either case, the user has to look into the code to see what that value is. (note that they don't need to know the exact value. If they aren't seeing enough inhibition, simply cranking up the weight of the transform to the connection to the |
@jgosmann I like those names and will edit the code. @xchoo nvm what I said before, I had the misconception that a too-low gain was easier to compensate for than a too-high gain. I'm now indifferent to the Jan, in terms of better documentation of the constant, is a comment on the inhibition parameter and an inline code comment acceptable? |
ec5fb14
to
5b069b9
Compare
I added the fixes and tried to rebase to master. Somehow I ended up attributing everything to Jan... How do I got about fixing this attribution? Alternatively, are people okay with merging to master with this mis-attribution? |
It's not a matter of me being fine or not with the inhibition gain being 1. There is a good reason why it is set to 1.5, and i've stated it here: #797 (comment) I'm not entirely sure what the hangup on the scale is... If I were to define the same parameter for say the ensemble array, the initial value for the inhibitory scale I would have set to 3. Saying that the user would be expecting a 1 doesn't mean anything because if you set it to 1, the inhibition just doesn't work. Same thing here. If by 'setting the initial inhibitory gain to 1' you mean that to the user facing world, the value is 1, but within the code, it scales it up by 1.5 (or whatever value we choose), then sure, i'm okay with that. |
I think I misread that comment, which is why I asked if "it was fine" which was a bit of a silly way of asking. Anyways, we've decided to keep with the Does the rest of the code look okay to you Xuan? I just changed the names of |
Is there a particular need to speed this one up? I am not ok with the authorship change; I have a local version of this branch that I can push to restore it, or we can just attribute it all to Xuan. |
I would still change the documentation of |
Yup. The rest of the code looks fine. Although, I'd make the inhibitory gain a class constant (so people will question the magical 1.5 in different parts of the code). |
Docstring for |
@Seanny123 You'll have to update the rest of the inhibition code (everywhere it says |
looks good |
yeah |
e55ad18
to
02d5ed0
Compare
I cleaned up the last few commit and fixed the attribution. Xuan, do you think this is ready to merge now? |
yeah. looks good to me |
The commit message still says |
Attempts to make the intent more clear, and reduce code duplication. - Changed output function from step function to filtered step function (smoother output) - Used `Exponential` dist for default intercepts distribution (for better filtered step function approximation) - Increased default number of neurons used in the AssociativeMemory - Split up code that does WTA, output thresholding, and default output vector logic. This enables users to specify different contexts for each of these operations.
Note: Contains both
assoc_mem_reorg
andexpdist
branches.