hmcalister / hopfield-network-go Goto Github PK
View Code? Open in Web Editor NEWAn implementation of the Hopfield Network in Golang.
License: MIT License
An implementation of the Hopfield Network in Golang.
License: MIT License
This is usually handled by bash scripts now anyway
Currently, the Hopfield network updates one unit at a time (the default behavior). It would be interesting to add functionality to update more than one unit per matrix multiplication.
Currently the activation function is applied before setting the unit in the state vector. This means activations that use the state vector will be incorrectly calculated.
This collector doesn't serve much purpose with the new networkSummary collector...
Currently the chunking function does not chunk correctly, as it iterates up one element at a time. This results in many chunks having the same elements, which is not ideal!
The fix here is to change the chunkingFunction for loop increment from i++
to i+=chunkSize
Currently a lot of network behavior is tied up in messy constant definitions. It would be better to make everything into a flag for command line argument parsing.
Data handlers currently all define a new function on a DataCollector to add an instance of the handler. It would be better to have an abstract AddDataHandler function that takes an instantiated instance of a type.
A new step is still taken with each new index, not each chunk as is expected.
Let's add these when we need to, and avoid getting too silly too quickly...
It appears that occasionally (actually very often) NaNs will appear in the states and unit energies of relaxing states when using ConcurrentRelaxStates. This should be considered a major bug, and needs to be addressed very quickly.
Network domain can be altered in the source code itself in future, as it would be a sufficiently large enough change. I am making a model not an enterprise solution!
Including, say, the norm activation for both Euclidian and Infinite norm
Currently the random matrix initialization uses a standard normalization. This means the random starting values could be significant (e.g. >1) . Changing the sigma in this call to something smaller would have the same effect but less impact on learning.
Currently, data collection occurs in the main method and is changed as the experiment requires. It would be nice to have an easier method to select data collection. For example, having a DataCollector struct that can be built to required specifics (and hence easily specified) and have callbacks in the HopfieldNetwork methods.
For some reason, the data file tends to sometimes corrupt data - either writing incorrect number of rows into the file or missing data in some columns compared to others.
Trial index is currently left over in the data collector structs. Because trials are no longer supported in the simulation directly, it would be best to remove trial index from these structs
Currently, Docstrings use an ugly syntax looking like
argName
: ...It would be much nicer to simplify these. Perhaps to something like:
argName: ...
The Hopfield network works best when states are equal to their inverse. This can be implemented by reversing states with a low-value first unit (forcing the first unit to always be the high value) and altering all other units to match, or by breaking the symmetry with a bias unit.
Chunking may result in poor performance for, e.g., chunkSize = 1. In this case we don't even need to chunk, just iterate over the original list!!
It would be nice to have a special case for chunkSize = 1 that does not require the (relatively) expensive chunking function.
Allow learning rules to run for multiple epochs
Currently, a keyboard interrupt is only detected at the start of a new trial. It would be nice to have the interrupt occur at ANY point throughout the program
Implement a chunking function that converts a slice into multiple slices of a specified length.
This will be required by #7
Implement the learning rules, like Hebbian and Delta
Currently the generated state function does not care if the generated state is unique with respect to previously generated states. It would be nice to ensure the generated states are unique.
Shift dataCollector to use threads and channels to avoid go concurrent map accesses
This effectively corrupts the data file.
Logging can and will be useful for this project. It is the easiest way to identify and diagnose bugs.
It appears that the log package is very intuitive...
Collect data on target states directly, rather than relying on finding states during relaxation
Currently, the returned type of the relaxation functions is a simple bool (stable or not). It would be better to measure other features (such as number of iterations to stabilize).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.