models_reservoirs.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:smp_base 作者: x75 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号