I am currently studiying LSMs and after reading several papers, i think that I grasped the main inforamtions about this model of Reservoir Computing.
However, I am struggling to get good results with the model I use for the Lorenz Attractor.
For now, I am trying to predict the X component only and I have pretty bad results.
I tried two kind of generators from NEST simulator. The spike_generator and and the step_current_generator.
I have better results with the step_current_generator but I want to stick to the W.Maas model and use a spike_generator.
Here is what i do :
def generate_spike_times_lorenz(data, stim_times, gen_burst, scale_factor=100.0):
"""
Generate spike times based on the Lorenz X component.
Parameters:
- data: array-like, values of the Lorenz X component.
- stim_times: array-like, times at which stimuli are given.
- gen_burst: function, generates a burst of spikes around a given time.
- scale_factor: float, factor to scale the spike times.
Returns:
- inp_spikes: list of arrays, each array contains the spike times for an input neuron.
"""
inp_spikes = []
data = data * scale_factor
for value, t in zip(data, stim_times):
spike_count = int(value)
if spike_count > 0:
spikes = np.concatenate([t + gen_burst() for _ in range(spike_count)])
# Scale and adjust spike times
spikes *= 10
spikes = spikes.round() + 1.0
spikes = spikes / 10.0
spikes = np.sort(spikes)
inp_spikes.append(spikes)
else:
inp_spikes.append(np.array([]))
return inp_spikes
def inject_spikes(inp_spikes, neuron_targets):
spike_generators = nest.Create("spike_generator", len(inp_spikes))
for sg, sp in zip(spike_generators, inp_spikes):
nest.SetStatus(sg, {'spike_times': sp})
C_inp = 100 # int(N_E / 20) # number of outgoing input synapses per input neuron
def generate_delay_normal_clipped(mu=10., sigma=20., low=3., high=200.):
delay = np.random.normal(mu, sigma)
delay = max(min(delay, high), low)
return delay
nest.Connect(spike_generators, neuron_targets,
{'rule': 'fixed_outdegree',
'outdegree': C_inp},
{'synapse_model': 'static_synapse',
'delay': generate_delay_normal_clipped(),
'weight': nest.random.uniform(min=2.5 * 10 * 5.0, max=7.5 * 10 * 5.0)})
Would anyone be able to provide insights or suggestions on how I can improve my model, especially in terms of using the spike_generator for better performance? Are there any specific parameters or techniques that I might be overlooking?
Thank you very much for your time and assistance.