from ca.nengo.model.impl import * from ca.nengo.model import * from ca.nengo.model.nef.impl import * from ca.nengo.model.neuron.impl import * from ca.nengo.model.neuron import * from ca.nengo.math.impl import * from ca.nengo.model.plasticity.impl import * from ca.nengo.util import * from ca.nengo.math import * #Introduce rate-based learning rule class MyFunction(AbstractFunction): #Define the rule serialVersionUID = 1 def __init__(self): AbstractFunction.__init__(self,7) def map(self,x): kappa=6e-5; #1e-4 is good with oja #return kappa*x[0]*x[6] #original learning rule return kappa*(x[0]*x[6]-(x[0]**2)*x[2]) #oja normalization, smoother results