26typedef unsigned long fract probability_t;
30 uint32_t allow_self_connections;
31 probability_t probability;
55 obj->params = *params_sdram;
56 *
region = ¶ms_sdram[1];
58 log_debug(
"Fixed Probability Connector, allow self connections = %u, "
60 obj->params.allow_self_connections, (accum) obj->params.probability);
92 void *generator, uint32_t pre_lo, uint32_t pre_hi,
93 uint32_t post_lo, uint32_t post_hi, UNUSED uint32_t post_index,
94 uint32_t post_slice_start, uint32_t post_slice_count,
95 unsigned long accum weight_scale, accum timestep_per_delay,
96 param_generator_t weight_generator, param_generator_t delay_generator,
101 uint32_t post_start = max(post_slice_start, post_lo);
102 uint32_t post_end =
min(post_slice_start + post_slice_count - 1, post_hi);
104 for (uint32_t pre = pre_lo; pre <= pre_hi; pre++) {
105 for (uint32_t post = post_start; post <= post_end; post++) {
106 if (pre == post && !obj->params.allow_self_connections) {
114 if (value < obj->
params.probability) {
115 uint32_t local_post = post - post_slice_start;
120 weight, delay, weight_scale)) {
static void * connection_generator_fixed_prob_initialise(void **region)
Initialise the fixed-probability connection generator.
static bool connection_generator_fixed_prob_generate(void *generator, uint32_t pre_lo, uint32_t pre_hi, uint32_t post_lo, uint32_t post_hi, uint32_t post_index, uint32_t post_slice_start, uint32_t post_slice_count, unsigned long accum weight_scale, accum timestep_per_delay, param_generator_t weight_generator, param_generator_t delay_generator, matrix_generator_t matrix_generator)
Generate connections with the fixed-probability connection generator.
static void connection_generator_fixed_prob_free(void *generator)
Free the fixed-probability connection generator.
The data structure to be passed around for this connector.
The parameters that can be copied in from SDRAM.
void log_warning(const char *message,...)
void log_debug(const char *message,...)
General types associated with generators.
static uint16_t rescale_delay(accum delay, accum timestep_per_delay)
Rescales a delay to account for timesteps and type-converts it.
bool matrix_generator_write_synapse(matrix_generator_t generator, uint32_t pre_index, uint16_t post_index, accum weight, uint16_t delay, unsigned long accum weight_scale)
Write a synapse with a matrix generator.
The data for a matrix generator.
rng_t * core_rng
An RNG that is local to the current core.
accum param_generator_generate(param_generator_t generator)
Generate value with a parameter generator.
uint32_t rng_generator(rng_t *rng)
Generate a uniformly-distributed random number.
Random number generator interface.
void sark_free(void *ptr)
region
spike source array region IDs in human readable form
static stdp_params params
Configuration parameters.