logistic_regression_tf.py 文件源码

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

项目:lecture-ss17-deep-learning 作者: bbaeuml 项目源码 文件源码
def dcost_fun(y, t, phi, batch_size):
    """computes the gradient of the cost wrt. the weights
    Args:
      y, t: the predicted probability and target variable tensors of shape (N_examples, K_classes)
      phi: feature tensor of shape (N_examples, dim_phi)

    Returns:
      The gradient tensor of shape (dim_phi, K_classes).
    """
    return tf.tensordot(phi, (y - t), axes=([0],[0]))/batch_size
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号