Exemple #1
0
 def create_updater(self):
     half_life_start, half_life_end = self.half_life
     self.updater = clda.KFRML(self.batch_time,
                               half_life_start,
                               adapt_C_xpose_Q_inv_C=False)
     self.updater.set_stable_inds(self.stable_unit_inds,
                                  stable_inds_independent=True)
 def create_updater(self):
     self.updater = clda.KFRML(None, None, self.batch_time, self.half_life)
import numpy as np 

from tasks import bmi_recon_tasks
from riglib.bmi import clda
reload(bmi_recon_tasks)
reload(tasks)
    

cls=tasks.KFRMLCGRecon

idx = 5275

te = performance._get_te(idx)

### TODO some CLDA blocks have a changing half life...
updater = clda.KFRML(None, None, te.batch_time, te.half_life[0])
updater.init(te.seed_decoder)

param_hist = te.hdf.root.clda
C_error = []
Q_error = []
decoder = te.seed_decoder

for k in range(len(param_hist))[5::6]:
    intended_kin = param_hist[k]['intended_kin']

    spike_counts = param_hist[k]['spike_counts_batch']
    if not np.any(np.isnan(intended_kin)) and not np.any(np.isnan(spike_counts)):
        new_params = updater.calc(intended_kin, spike_counts, decoder)
        decoder.update_params(new_params)
        C_error.append(np.max(np.abs(decoder.filt.C - param_hist[k]['kf_C'])))
Exemple #4
0
 def create_updater(self):
     half_life_start, half_life_end = self.half_life
     self.updater = clda.KFRML(self.batch_time, half_life_start)
 def create_updater(self):
     self.updater = clda.KFRML(self.batch_time, self.half_life[0])
     self.updater.default_gain = self.memory_decay_rate