def __init__(self, Model): self.input = Model.input self.output = Model.output self.input_test = Model.input_test self.output_test = Model.output_test self.gradient_ker = diff.gradient_ker(Model) self.gradient_NL = diff.gradient_NL(Model) self.hessian_ker = diff.hessian_ker(Model) self.hessian_NL = diff.hessian_NL(Model) self.paramKer = Model.paramKer self.paramNL = Model.paramNL self.lls = Model.lls self.Mds = Model.Mds self.switches = Model.switches #self.neustd = Model.neustd self.likelihood = diff.likelihood(Model) self.sub_membrane_potential = diff.subMembPot(Model, 'training') self.membrane_potential = diff.MembPot(Model)
def renormalize(self): std = self.sub_membrane_potential.std() self.paramKer = (1. / std) * self.paramKer self.membrane_potential = diff.MembPot(self) self.update()
def update(self): self.sub_membrane_potential = diff.subMembPot(self, 'training') self.membrane_potential = diff.MembPot(self) self.likelihood = diff.likelihood(self) self.gradient_ker = diff.gradient_ker(self) self.hessian_ker = diff.hessian_ker(self) self.gradient_NL = diff.gradient_NL(self) self.hessian_NL = diff.hessian_NL(self)
def add_data(self, neuron): #import data from neuron Nsteps = neuron.total_time / self.dt self.input = neuron.input self.output = [neuron.output] self.paramKer[-1] = -math.log( len(neuron.output) / float(neuron.total_time)) #initialize for fit. #self.neustd = neuron.sub_memb_pot.std() self.sub_membrane_potential = diff.subMembPot(self, 'training') self.membrane_potential = diff.MembPot(self) self.input_test = neuron.input_test self.output_test = neuron.output_test
def membpot(self): self.sub_membrane_potential = diff.subMembPot(self, 'training') self.membrane_potential = diff.MembPot(self)