__init__.py 文件源码

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

项目:mimicry.ai 作者: fizerkhan 项目源码 文件源码
def get_params(cost, criterion=lambda x: hasattr(x, 'param') and x.param==True):
    """
    Default criterion:
        lambda x: hasattr(x, 'param') and x.param==True
    This will return every parameter for cost from computation graph.

    To exclude a parameter, just set 'param' to False:
        >>> h0 = lib.param('h0',\
                numpy.zeros((3, 2*512), dtype=theano.config.floatX))
        >>> print h0.param  # Default: True
        >>> h0.param = False

    In this case one still can get list of all params (False or True) by:
        >>> lib.get_params(cost, lambda x: hasattr(x, 'param')

    :returns:
        A list of params
    """
    return search(cost, criterion)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号