-
Notifications
You must be signed in to change notification settings - Fork 21
Added STDP AltAI example, and refactored example accordingly. #150
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
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
b332ddf
Added forgotten altai stdp functionality: #145
DavidIkov 7ff5c7d
Started refactoring mnist example, added arguments parsing: #145
DavidIkov a8c18c1
Added core functionality for examples, now they can run and produce r…
DavidIkov 55f7ee8
Added abillity to save detailed logs: #145
DavidIkov 2952c93
Added model saving: #145
DavidIkov bb1fa0e
Moved inference results evaluation to separate function: #145
DavidIkov 21779d6
Added trained network finalization: #145
DavidIkov f9088e1
Changed include type in models to fix pre-commit: #145
DavidIkov 4dd1777
Separated model.cpp into multiple files: #145
DavidIkov 756a1e5
Simplified network construction in examples: #145
DavidIkov 4ec8373
Changed neurons naming to match naming convention: #145
DavidIkov 78a7df9
Added some hyperparameters: #145
DavidIkov 9280c40
Added custom spikes generators for each model type: #145
DavidIkov 8be21ea
Changed switch case to template specializations: #145
DavidIkov 378cee1
Added back debug trace logging: #145
DavidIkov 1922c3b
Changed original authors: #145
DavidIkov 1a0cc4f
Added readme back: #145
DavidIkov 5765281
Removed some double empty lines in network construction: #145
DavidIkov 2f95001
Unified several .h files into one, to make example more compact: #145
DavidIkov 6ae6838
Removed shared folder: #145
DavidIkov 3f3a928
Removed forgotten logging in qunatization of weights in mnist altai: …
DavidIkov 7a89c0a
Changed some comments: #145
DavidIkov 9785e33
Made some changes due to PR: #145
DavidIkov 055bd25
Updated licence years: #145
DavidIkov 54d24dc
Removed some spike generators: #145
DavidIkov 00cf85c
Moved PopulationInfo and PopulationRole into global namespace: #145
DavidIkov 5f02eb2
Moved save network source to header: #145
DavidIkov 5256d78
Added const to UID: #145
DavidIkov c1cd738
Separated network construction into multiple functions: #145
DavidIkov 205b3b2
Added comments to some of settings parameters: #145
DavidIkov a23bb8c
Removed includes at end of network_functions.h: #145
DavidIkov 7d2a74b
Added comments for all functions, and some parts of code: #145
DavidIkov 713c7dd
Added some more comments: #145
DavidIkov a7a6937
Fixed clang build: #145
DavidIkov 899991e
Added mnist-learn to autodoc, and added proper comments: #145
DavidIkov 84988f5
Changed types of values in blifat/settings.h: #145
DavidIkov 772df5d
Fixed grammar in comments: #145
DavidIkov 1e98a1b
Renamed settings.h files: #145
DavidIkov 37ff4ae
Made changes according to PR comments: #145
DavidIkov 7bd838f
Changed include type: #145
DavidIkov 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 was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| /** | ||
| * @file dataset.cpp | ||
| * @brief Process dataset. | ||
| * @kaspersky_support D. Postnikov | ||
| * @date 03.02.2026 | ||
| * @license Apache 2.0 | ||
| * @copyright © 2026 AO Kaspersky Lab | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| #include "dataset.h" | ||
|
|
||
| #include <fstream> | ||
|
|
||
| #include "global_config.h" | ||
|
|
||
|
|
||
| Dataset process_dataset(ModelDescription const& model_desc) | ||
| { | ||
| // Create streams for images and labels. | ||
| std::ifstream images_stream(model_desc.images_file_path_, std::ios::binary); | ||
| std::ifstream labels_stream(model_desc.labels_file_path_, std::ios::in); | ||
|
|
||
| Dataset dataset; | ||
| // Process them. | ||
| dataset.process_labels_and_images( | ||
| images_stream, labels_stream, model_desc.train_images_amount_ + model_desc.inference_images_amount_, | ||
| classes_amount, input_size, steps_per_image, | ||
| dataset.make_incrementing_image_to_spikes_converter(active_steps, state_increment_factor)); | ||
| // Split dataset according to model description. | ||
| dataset.split(model_desc.train_images_amount_, model_desc.inference_images_amount_); | ||
|
|
||
| // Print out results. | ||
| std::cout << "Processed dataset, training will last " << dataset.get_steps_amount_for_training() | ||
| << " steps, inference " << dataset.get_steps_amount_for_inference() << " steps\n" | ||
| << std::endl; | ||
|
|
||
|
artiomn marked this conversation as resolved.
|
||
| return dataset; | ||
| } | ||
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.