Exemple #1
0
void TripletConnection::propagate_forward()
{
	// loop over all spikes
	for (SpikeContainer::const_iterator spike = src->get_spikes()->begin() ; // spike = pre_spike
			spike != src->get_spikes()->end() ; ++spike ) {
		// loop over all postsynaptic partners
		for (const NeuronID * c = w->get_row_begin(*spike) ; 
				c != w->get_row_end(*spike) ; 
				++c ) { // c = post index

			// transmit signal to target at postsynaptic neuron
			AurynWeight * weight = w->get_data_ptr(c); 
			transmit( *c , *weight );

			// handle plasticity
			if ( stdp_active ) {
				// performs weight update
			    *weight += dw_pre(*c);

			    // clips too small weights
			    if ( *weight < get_min_weight() ) 
					*weight = get_min_weight();
			}
		}
	}
}
Exemple #2
0
void TripletConnection::propagate_forward()
{
	for (SpikeContainer::const_iterator spike = src->get_spikes()->begin() ; // spike = pre_spike
			spike != src->get_spikes()->end() ; ++spike ) {
		for (NeuronID * c = w->get_row_begin(*spike) ; c != w->get_row_end(*spike) ; ++c ) { // c = post index
			AurynWeight value = fwd_data[c-fwd_ind]; 
			transmit( *c , value );
			if ( stdp_active ) {
			  fwd_data[c-fwd_ind] -= dw_pre(*c);
			  if ( fwd_data[c-fwd_ind] < get_min_weight() ) 
				fwd_data[c-fwd_ind] = get_min_weight();
			}
		}
		// update pre_trace
		// tr_pre->inc(*spike);
	}
}
inline void SymmetricSTDPConnection::propagate_forward()
{
	NeuronID * ind = w->get_row_begin(0); // first element of index array
	AurynWeight * data = w->get_data_begin();
	AurynWeight value;
	SpikeContainer::const_iterator spikes_end = src->get_spikes()->end();
	// process spikes
	for (SpikeContainer::const_iterator spike = src->get_spikes()->begin() ; // spike = pre_spike
			spike != spikes_end ; ++spike ) {
		for (NeuronID * c = w->get_row_begin(*spike) ; c != w->get_row_end(*spike) ; ++c ) {
			value = data[c-ind]; 
			// dst->tadd( *c , value , transmitter );
			transmit( *c, value );
			NeuronID translated_spike = dst->global2rank(*c);
			  data[c-ind] += dw_pre(translated_spike);
			if (data[c-ind] < get_min_weight()) {
				data[c-ind] = get_min_weight();
			}
		}
	}
}