Advertisement
Guest User

2.1.3.linearity_forward.py

a guest
Aug 22nd, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.35 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. """
  4. Created on Thu Aug 16 14:04:15 2018
  5.  
  6. @author: apple
  7. """
  8.  
  9. import numpy as np
  10.  
  11. D = 784  # 数据维度
  12. K = 10  # 类别数
  13. N = 128  # 样本数量
  14.  
  15. X = np.random.randn(N, D) # 数据矩阵,每行一个样本
  16. W = 0.01 * np.random.randn(D,K)
  17. b = np.zeros((1,K))
  18. scores = np.dot(X, W) + b # 广播机制
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement