-
Notifications
You must be signed in to change notification settings - Fork 21
MT backend STDP #67
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
Merged
Merged
MT backend STDP #67
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2bb011f
Add some functions and tests for STDP mp, learning not working yet: #…
a-vartenkov 7a22e72
Add STDP to multithreaded backend, no checks yet: #0000039
a-vartenkov 5bb6999
Add modifications to synapse status, not mp backend works: #0000038
a-vartenkov ccc9545
Merge branch 'master' into mpback_stdp
a-vartenkov fc99830
Remove a file that's no longer needed: #0000039
a-vartenkov 458de96
Move finalize template specialization to another file: #0000039
a-vartenkov 436926f
Resolve comments: #0000039
a-vartenkov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ | |
| #include <knp/core/message_bus.h> | ||
| #include <knp/core/projection.h> | ||
| #include <knp/synapse-traits/delta.h> | ||
| #include <knp/synapse-traits/stdp_synaptic_resource_rule.h> | ||
|
|
||
| #include <spdlog/spdlog.h> | ||
|
|
||
|
|
@@ -132,15 +133,15 @@ template <class DeltaLikeSynapse> | |
| void calculate_projection_part_impl( | ||
| knp::core::Projection<DeltaLikeSynapse> &projection, | ||
| const std::unordered_map<knp::core::Step, size_t> &message_in_data, MessageQueue &future_messages, uint64_t step_n, | ||
| size_t part_start, size_t part_size, std::mutex &mutex) | ||
| uint64_t part_start, uint64_t part_size, std::mutex &mutex) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. А чем size_t не угодил (допустим на чём-то мелком 32-битном запускать будут)? |
||
| { | ||
| size_t part_end = std::min(part_start + part_size, projection.size()); | ||
| std::vector<std::pair<uint64_t, knp::core::messaging::SynapticImpact>> container; | ||
| WeightUpdateStdpMp<DeltaLikeSynapse>::init_projection_part(projection, message_in_data, step_n); | ||
| for (size_t synapse_index = part_start; synapse_index < part_end; ++synapse_index) | ||
| { | ||
| auto &synapse = projection[synapse_index]; | ||
| // update_step(synapse.params_, step_n); | ||
| // TODO: Move update logic here too. | ||
| auto iter = message_in_data.find(std::get<core::source_neuron_id>(synapse)); | ||
| if (iter == message_in_data.end()) | ||
| { | ||
|
|
@@ -150,6 +151,7 @@ void calculate_projection_part_impl( | |
| // Add new impact. | ||
| // The message is sent on step N - 1, received on step N. | ||
| uint64_t key = std::get<core::synapse_data>(synapse).delay_ + step_n - 1; | ||
| WeightUpdateStdpMp<DeltaLikeSynapse>::init_synapse(std::get<core::synapse_data>(synapse), step_n); | ||
|
|
||
| knp::core::messaging::SynapticImpact impact{ | ||
| synapse_index, std::get<core::synapse_data>(synapse).weight_ * iter->second, | ||
|
|
@@ -183,6 +185,7 @@ void calculate_projection_part_impl( | |
| future_messages.insert(std::make_pair(value.first, message_out)); | ||
| } | ||
| } | ||
| WeightUpdateStdpMp<DeltaLikeSynapse>::modify_weights_part(projection); | ||
| } | ||
|
|
||
|
|
||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.