-
Notifications
You must be signed in to change notification settings - Fork 69
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
Added permute method to HRR.py; created HDM.py #2
Open
MatthewAKelly
wants to merge
9
commits into
tcstewar:master
Choose a base branch
from
MatthewAKelly:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added a BEAGLE/DSHM based memory system as an alternative to standard ACT-R DM. Some notes: 1. HDM takes chunks that are sets of slot:value pairs, (e.g., "colour:yellow shape:square size:small") but not chunks without slots (e.g., "yellow square small"). I plan to add the ability to handle chunks without slots, but haven't yet. 2. A retrieval query to HDM must specify the value that is being retrieved and must specify no more than one value (e.g., "colour:yellow shape:? size:small"). The chunks "colour:yellow shape:square" and "colour:yellow shape:? size:?" are not valid queries. 3. There's a bunch of junk code from the original DM that's still in there, probably does nothing, and I'm afraid to delete it. 4. Reaction time is controlled with the "recall" function, which I haven't modified. Currently vector cosine feeds right into the recall function. The recall function may need to be tweaked to produce sensible reaction times.
.permute(permutation) allows you to permute an HRR object. This method is used in HDM (Holographic Declarative Memory) and is generally useful for any program using HRRs.
HDM now supports encoding without slots when adding and retrieving chunks. Also: HDM added to __init__.py
Added comments to explain HDM's parameters. N is now a parameter that controls vector dimensionality. Threshold now sets the minimum cosine in the request function. Fixed the slot-free code so that it doesn't add the placeholder by itself into memory and query vectors. Changed comments on slot-value code to reflect the fact that the placeholder is added in by itself under these conditions, but permuted by its slot.
Added resonance function for recognition tasks. Added comments for readability.
Changed the permute function so that it's more elegant, and probably faster.
Changed how HDM constructs memory vectors and query vectors. New version of code no longer uses the max_gram_size parameter as all grams within the chunk are computed. New version is both faster to run and more concise in terms of both lines of code and machine instructions. I probably changed other things too.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a permute method to the HRR class in the HRR.py file. Seems like an obvious thing to add to the HRR toolbox, and worth adding to your master copy.
I've also added HDM.py to my branch, but HDM.py isn't ready for prime time (in my opinion). It's an implementation of a BEAGLE/DSHM thing as a substitute for ACT-R's DM and seems to be working, but we're continuing to test it. It was made by modifying DM.py, so it probably contains a bunch of code that isn't doing anything and could be deleted, but I'm a little afraid to delete things I don't understand.