Kaspersky Neuromorphic Platform  1.0.0
API Reference
Loading...
Searching...
No Matches
connectors.h
Go to the documentation of this file.
1
21#pragma once
22
23#include <knp/core/population.h>
24#include <knp/core/projection.h>
25
26#include <optional>
27
28#include "creators.h"
30
35{
36
49template <typename SynapseType, typename SourceNeuronType, typename DestinationNeuronType>
50[[nodiscard]] typename core::Projection<SynapseType> connect_populations(
51 const core::Population<SourceNeuronType> &src, const core::Population<DestinationNeuronType> &dst,
54{
55 return creators::all_to_all<SynapseType>(src.get_uid(), dst.get_uid(), src.size(), dst.size(), syn_gen);
56}
57
58
71template <typename SynapseType, typename SourceNeuronType, typename DestinationNeuronType>
72[[nodiscard]] typename core::Projection<SynapseType> connect_populations(
73 const core::Population<SourceNeuronType> &src, const core::Population<DestinationNeuronType> &dst,
74 typename knp::core::Projection<SynapseType>::SynapseGenerator syn_gen, size_t num_iterations)
75{
76 return core::Projection<SynapseType>(src.get_uid(), dst.get_uid(), syn_gen, num_iterations);
77}
78
79} // namespace knp::framework::projection
const UID & get_uid() const
Get population UID.
Definition population.h:88
size_t size() const
Count number of neurons in the population.
Definition population.h:233
std::function< std::optional< Synapse >(size_t)> SynapseGenerator
Synapse generation function type.
Definition projection.h:97
knp::core::Projection< SynapseType > all_to_all(const knp::core::UID &presynaptic_uid, const knp::core::UID &postsynaptic_uid, size_t presynaptic_pop_size, size_t postsynaptic_pop_size, parameters_generators::SynGen2ParamsType< SynapseType > syn_gen=parameters_generators::default_synapse_gen< SynapseType >)
Make connections between each presynaptic population (source) neuron to each postsynaptic population ...
Definition creators.h:62
std::function< typename knp::core::Projection< SynapseType >::SynapseParameters(size_t, size_t)> SynGen2ParamsType
Two parameters (index, index) generator type.
knp::core::Projection< SynapseType >::SynapseParameters default_synapse_gen(size_t, size_t)
Default generator of synapse parameters.
Projection namespace.
Definition connectors.h:35
core::Projection< SynapseType > connect_populations(const core::Population< SourceNeuronType > &src, const core::Population< DestinationNeuronType > &dst, typename parameters_generators::SynGen2ParamsType< SynapseType > syn_gen=parameters_generators::default_synapse_gen< SynapseType >)
Connect presynaptic and postsynaptic populations.
Definition connectors.h:50
General population interface.
Projection creators.
General projection interface.
Parameters generators.