Exemplo n.º 1
0
void TIFGroup::evolve()
{
	for (NeuronID i = 0 ; i < get_rank_size() ; ++i ) {
    	if (t_ref[i]==0) {
			const AurynFloat dg_mem = ( (e_rest-t_mem[i]) 
					- t_g_ampa[i] * t_mem[i]
					- t_g_gaba[i] * (t_mem[i]-e_rev)
					+ t_bg_cur[i] );
			t_mem[i] += dg_mem*scale_mem;

			if (t_mem[i]>thr) {
				push_spike(i);
				t_mem[i] = e_rest ;
				t_ref[i] += refractory_time ;
			} 
		} else {
			t_ref[i]-- ;
			t_mem[i] = e_rest ;
		}

	}

    auryn_vector_float_scale(scale_ampa,g_ampa);
    auryn_vector_float_scale(scale_gaba,g_gaba);
}
Exemplo n.º 2
0
void AIFGroup::integrate_linear_nmda_synapses()
{
	// decay of ampa and gaba channel, i.e. multiply by exp(-dt/tau)
    auryn_vector_float_scale(scale_ampa,g_ampa);
    auryn_vector_float_scale(scale_gaba,g_gaba);
    auryn_vector_float_scale(scale_adapt1,g_adapt1);

    // compute dg_nmda = (g_ampa-g_nmda)*dt/tau_nmda and add to g_nmda
	AurynFloat mul_nmda = dt/tau_nmda;
    auryn_vector_float_saxpy(mul_nmda,g_ampa,g_nmda);
	auryn_vector_float_saxpy(-mul_nmda,g_nmda,g_nmda);

    // excitatory
    auryn_vector_float_copy(g_ampa,t_exc);
    auryn_vector_float_scale(-A_ampa,t_exc);
    auryn_vector_float_saxpy(-A_nmda,g_nmda,t_exc);
    auryn_vector_float_mul(t_exc,mem);
    
    // inhibitory
    auryn_vector_float_copy(g_gaba,t_leak); // using t_leak as temp here
    auryn_vector_float_saxpy(1,g_adapt1,t_leak);
    auryn_vector_float_copy(mem,t_inh);
    auryn_vector_float_add_constant(t_inh,-e_rev);
    auryn_vector_float_mul(t_inh,t_leak);
}
Exemplo n.º 3
0
void IF2Group::integrate_nonlinear_nmda_synapses()
{
	// decay of ampa and gaba channel, i.e. multiply by exp(-dt/tau)
    auryn_vector_float_scale(scale_ampa,g_ampa);
    auryn_vector_float_scale(scale_gaba,g_gaba);

    // compute dg_nmda = (g_ampa-g_nmda)*dt/tau_nmda and add to g_nmda
	AurynFloat mul_nmda = dt/tau_nmda;
    auryn_vector_float_saxpy(mul_nmda,g_ampa,g_nmda);
	auryn_vector_float_saxpy(-mul_nmda,g_nmda,g_nmda);

	// BEGIN implement NMDA voltage dependence
	auryn_vector_float_copy( mem, nmda_opening);
	auryn_vector_float_add_constant( nmda_opening , -e_nmda_onset );
	auryn_vector_float_scale( nmda_slope, nmda_opening );
	for ( AurynState * ptr = auryn_vector_float_ptr( nmda_opening , 0 ) ; ptr != auryn_vector_float_ptr( nmda_opening , get_post_size()-1 )+1 ; ++ptr ) {
		AurynFloat x = *ptr;
		AurynFloat x2 = x*x;
		AurynFloat r = x2/(1.0+x2);
		if (x>0) *ptr = r; // rectification
		else *ptr = 0;
		// cout << *ptr << endl;
	}
	// END implement NMDA voltage dependence
	
    // excitatory
    auryn_vector_float_copy(g_nmda,t_exc);
    auryn_vector_float_scale(-A_nmda,t_exc);
	auryn_vector_float_mul(t_exc,nmda_opening);
    auryn_vector_float_saxpy(-A_ampa,g_ampa,t_exc);
    auryn_vector_float_mul(t_exc,mem);
    
    // inhibitory
    auryn_vector_float_copy(mem,t_inh);
    auryn_vector_float_add_constant(t_inh,-e_rev);
    auryn_vector_float_mul(t_inh,g_gaba);
}
Exemplo n.º 4
0
/*!
       This method applies the Euler integration step to the membrane dynamics.
 */
void AIFGroup::integrate_membrane()
{
	// moving threshold
    auryn_vector_float_scale(scale_thr,thr);
    
    // leak
	auryn_vector_float_copy(mem,t_leak);
    auryn_vector_float_add_constant(t_leak,-e_rest);
    
    // membrane dynamics
	AurynFloat mul_tau_mem = dt/tau_mem;
    auryn_vector_float_saxpy(mul_tau_mem,t_exc,mem);
    auryn_vector_float_saxpy(-mul_tau_mem,t_inh,mem);
    auryn_vector_float_saxpy(-mul_tau_mem,t_leak,mem);
}