sPyNNaker neural_modelling  development
elimination_random_by_weight_impl.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 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 
19 #ifndef _ELIMINATION_RANDOM_BY_WEIGHT_IMPL_H_
20 #define _ELIMINATION_RANDOM_BY_WEIGHT_IMPL_H_
21 
22 #include "elimination.h"
23 
32  uint32_t threshold;
33 };
34 
42  current_state_t *restrict current_state,
43  const elimination_params_t *params,
44  UNUSED uint32_t time, synaptic_row_t restrict row) {
45  uint32_t random_number = mars_kiss64_seed(*(current_state->local_seed));
46 
47  // Is weight depressed?
48  if (current_state->weight < params->threshold &&
49  random_number > params->prob_elim_depression) {
50  return false;
51  }
52 
53  // Is weight potentiated or unchanged?
54  if (current_state->weight >= params->threshold &&
55  random_number > params->prob_elim_potentiation) {
56  return false;
57  }
58 
59  return sp_structs_remove_synapse(current_state, row);
60 }
61 
62 #endif // _ELIMINATION_RANDOM_BY_WEIGHT_IMPL_H_
static uint32_t time
Simulation time.
API for synapse elimination.
uint32_t prob_elim_depression
Probability of elimination of depressed synapse.
uint32_t prob_elim_potentiation
Probability of elimination of potentiated synapse.
static bool synaptogenesis_elimination_rule(current_state_t *restrict current_state, const elimination_params_t *params, uint32_t time, synaptic_row_t restrict row)
Elimination rule for synaptogenesis.
Configuration of synapse elimination rule.
struct synaptic_row * synaptic_row_t
The type of a synaptic row.
static bool sp_structs_remove_synapse(current_state_t *restrict current_state, synaptic_row_t restrict row)
Removes a synapse from the relevant structures.
Definition: sp_structs.h:196
struct representing the current state of rewiring
Definition: sp_structs.h:92
static stdp_params params
Configuration parameters.