def create_matrix_sparse_from_conf(conf):
restypes = ['tdnn', 'lpfb']
# tdnn res weights = []
if 'restype' not in conf or conf['restype'] not in restypes:
return None
else:
if conf['restype'] == 'tdnn':
w_ = spa.dia_matrix(np.diag(np.ones((conf['N']-1,)), k = -1))
return w_
elif conf['restype'] == 'lpfb':
# w_ = spa.dia_matrix(np.diag(1 - (np.logspace(1e-3, 1e-1, conf['N']) - 1), k = 0))
w_ = spa.dia_matrix(np.diag(1 - np.exp(np.linspace(-6, -0.69, conf['N'])), k = 0))
return w_
return None
################################################################################
# Standalone class for learning rules
# - Recursive Least Squares (RLS, depends on rlspy.py): the vanilla online supervised
# reservoir training method
# - First-order reduced and controlled error or FORCE learning (Sussillo & Abbott, 2012)
# - FORCEmdn: Mixture density output layer using FORCE rule (Berthold, 2017)
# - Exploratory Hebbian learning (Legenstein & others, 2010)
评论列表
文章目录