Advertisement

CS231n Assignment 2 Q1 Assignment

阅读量:

Fully-Connected Nets

  • Affine Layer
    • ReLU Layer
    • TwoLayerNet
    • FullyConnectedNet
    • SGD+Momentum
    • RMSProp and Adam

Affine Layer

第一题要求我们构建一个全连接网络,首先需要完成一系列数据预处理步骤。其中第一个子任务是编写layers.py文件中与前向计算反向传播相关的代码实现,接下来将先展示代码内容,随后进行说明。首先是前向计算部分的代码实现:

复制代码
    def affine_forward(x, w, b):
    """
    Computes the forward pass for an affine (fully-connected) layer.
    
    The input x has shape (N, d_1, ..., d_k) and contains a minibatch of N
    examples, where each example x[i] has shape (d_1, ..., d_k). We will
    reshape each input into a vector of dimension D = d_1 * .

全部评论 (0)

还没有任何评论哟~