learning_methods.py 文件源码

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

项目:my_research 作者: MorvanZhou 项目源码 文件源码
def calculate_AFD(self, A, layer):
        X = A.copy()
        if layer < self.n_layers-1:
            if self.activation_function == 'ReLU':
                np.place(X, np.array(X > 0), 1)
                d = X.clip(0)
            elif self.activation_function == 'SoftPlus':
                d = 1/(1 + np.exp(-X))
            else:
                raise NameError(self.activation_function, ' is not in the name list')
        else:
            d = np.ones_like(X)
        return d
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号