sPyNNaker neural_modelling 7.3.1
Loading...
Searching...
No Matches
synapse_types_exponential_impl.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 The University of Manchester
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
28#ifndef _SYNAPSE_TYPES_EXPONENTIAL_IMPL_H_
29#define _SYNAPSE_TYPES_EXPONENTIAL_IMPL_H_
30
31//---------------------------------------
32// Macros
33//---------------------------------------
36#define SYNAPSE_TYPE_BITS 1
39#define SYNAPSE_TYPE_COUNT 2
40
42#define NUM_EXCITATORY_RECEPTORS 1
44#define NUM_INHIBITORY_RECEPTORS 1
45
46#include <debug.h>
47#include "synapse_types.h"
48#include "exp_synapse_utils.h"
49
50//---------------------------------------
51// Synapse parameters
52//---------------------------------------
53
57 REAL time_step_ms;
58};
59
60struct synapse_types_t {
63};
64
70
71//---------------------------------------
72// Synapse shaping inline implementation
73//---------------------------------------
74
75static inline void synapse_types_initialise(synapse_types_t *state,
77 decay_and_init(&state->exc, &params->exc, params->time_step_ms, n_steps_per_timestep);
78 decay_and_init(&state->inh, &params->inh, params->time_step_ms, n_steps_per_timestep);
79}
80
81static inline void synapse_types_save_state(synapse_types_t *state,
83 params->exc.init_input = state->exc.synaptic_input_value;
84 params->inh.init_input = state->inh.synaptic_input_value;
85}
86
95static inline void synapse_types_shape_input(
96 synapse_types_t *parameters) {
97 exp_shaping(&parameters->exc);
98 exp_shaping(&parameters->inh);
99}
100
108 index_t synapse_type_index, synapse_types_t *parameters,
109 input_t input) {
110 switch (synapse_type_index) {
111 case EXCITATORY:
112 add_input_exp(&parameters->exc, input);
113 break;
114 case INHIBITORY:
115 add_input_exp(&parameters->inh, input);
116 break;
117 }
118}
119
126 input_t *excitatory_response, synapse_types_t *parameters) {
127 excitatory_response[0] = parameters->exc.synaptic_input_value;
128 return &excitatory_response[0];
129}
130
137 input_t *inhibitory_response, synapse_types_t *parameters) {
138 inhibitory_response[0] = parameters->inh.synaptic_input_value;
139 return &inhibitory_response[0];
140}
141
147static inline const char *synapse_types_get_type_char(
148 index_t synapse_type_index) {
149 switch (synapse_type_index) {
150 case EXCITATORY:
151 return "X";
152 case INHIBITORY:
153 return "I";
154 default:
155 log_debug("did not recognise synapse type %i", synapse_type_index);
156 return "?";
157 }
158}
159
164static inline void synapse_types_print_input(
165 synapse_types_t *parameters) {
166 log_debug("%12.6k - %12.6k",
167 parameters->exc.synaptic_input_value,
168 parameters->inh.synaptic_input_value);
169}
170
174 synapse_types_t *parameters) {
175 log_debug("exc_decay = %R\n", parameters->exc.decay);
176 log_debug("exc_init = %R\n", parameters->exc.init);
177 log_debug("inh_decay = %R\n", parameters->inh.decay);
178 log_debug("inh_init = %R\n", parameters->inh.init);
179}
180
181#endif // _SYNAPSE_TYPES_EXPONENTIAL_IMPL_H_
uint32_t index_t
void log_debug(const char *message,...)
Utilities for synapse types with exponential decays.
static void decay_and_init(exp_state_t *state, exp_params_t *params, REAL time_step_ms, uint32_t n_steps_per_timestep)
Calculate the exponential state from the exponential parameters.
static void exp_shaping(exp_state_t *exp_param)
Shapes a single parameter.
static void add_input_exp(exp_state_t *parameter, input_t input)
helper function to add input for a given timer period to a given neuron
The type of exponential decay parameters.
The type of exponential decay state.
accum REAL
Type used for "real" numbers.
Definition maths-util.h:91
REAL input_t
The type of an input.
static uint n_steps_per_timestep
The number of steps to run per timestep.
static stdp_params params
Configuration parameters.
API for synaptic behaviour types (see also src/neuron/input_types)
decay_t decay
Exponential decay multiplier.
static const char * synapse_types_get_type_char(index_t synapse_type_index)
returns a human readable character for the type of synapse. examples would be X = excitatory types,...
static input_t * synapse_types_get_excitatory_input(input_t *excitatory_response, synapse_types_t *parameters)
extracts the excitatory input buffers from the buffers available for a given parameter set
static void synapse_types_add_neuron_input(index_t synapse_type_index, synapse_types_t *parameters, input_t input)
adds the inputs for a give timer period to a given neuron that is being simulated by this model
static void synapse_types_print_input(synapse_types_t *parameters)
prints the input for a neuron ID given the available inputs currently only executed when the models a...
exponential_synapse_input_buffer_regions
The supported synapse type indices.
@ INHIBITORY
Inhibitory synaptic input.
@ EXCITATORY
Excitatory synaptic input.
static void synapse_types_print_parameters(synapse_types_t *parameters)
printer call
static void synapse_types_shape_input(synapse_types_t *parameters)
decays the stuff thats sitting in the input buffers as these have not yet been processed and applied ...
static input_t * synapse_types_get_inhibitory_input(input_t *inhibitory_response, synapse_types_t *parameters)
extracts the inhibitory input buffers from the buffers available for a given parameter set
alpha_state_t inh
Inhibitory synaptic input.
alpha_params_t exc
First excitatory synaptic input.
alpha_state_t exc
Excitatory synaptic input.
Delta synapses support just a single excitatory and inhibitory input each.