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

Added permute method to HRR.py; created HDM.py #2

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

MatthewAKelly
Copy link

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.

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.
This rolls back to commit 9b29468.
.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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant