Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.99 KB | None | 0 0
  1. Last login: Sun Apr 26 14:30:29 on ttys000
  2. Daniels-MacBook-Pro:~ danielmxli$ ls
  3. Desktop Documents Library Music Public
  4. Development Downloads Movies Pictures
  5. Daniels-MacBook-Pro:~ danielmxli$ ssh cs61c-ev@star.cs.berkeley.edu
  6. ssh: connect to host star.cs.berkeley.edu port 22: Network is unreachable
  7. Daniels-MacBook-Pro:~ danielmxli$ ssh cs61c-ev@star.eecs.berkeley.edu
  8. ssh: Could not resolve hostname star.eecs.berkeley.edu: nodename nor servname provided, or not known
  9. Daniels-MacBook-Pro:~ danielmxli$ ssh cs61c-ev@star.berkeley.edu
  10. The authenticity of host 'star.berkeley.edu (128.32.25.86)' can't be established.
  11. RSA key fingerprint is 1f:68:69:a3:15:24:99:51:01:4a:ff:a8:ec:79:67:ec.
  12. Are you sure you want to continue connecting (yes/no)? yes
  13. Warning: Permanently added 'star.berkeley.edu,128.32.25.86' (RSA) to the list of known hosts.
  14. Password:
  15. Password:
  16. Password:
  17.  
  18. Daniels-MacBook-Pro:~ danielmxli$
  19. Daniels-MacBook-Pro:~ danielmxli$ ssh cs61-ev@hive25.cs.berkeley.edu
  20. cs61-ev@hive25.cs.berkeley.edu's password:
  21. Permission denied, please try again.
  22. cs61-ev@hive25.cs.berkeley.edu's password:
  23. Permission denied, please try again.
  24. cs61-ev@hive25.cs.berkeley.edu's password:
  25. Permission denied (publickey,password).
  26. Daniels-MacBook-Pro:~ danielmxli$ ssh cs61-ev@hive25.cs.berkeley.edu
  27. cs61-ev@hive25.cs.berkeley.edu's password:
  28. Permission denied, please try again.
  29. cs61-ev@hive25.cs.berkeley.edu's password:
  30.  
  31. Daniels-MacBook-Pro:~ danielmxli$
  32. Daniels-MacBook-Pro:~ danielmxli$ ssh cs61c-ev@hive25.cs.berkeley.edu
  33. cs61c-ev@hive25.cs.berkeley.edu's password:
  34. ----------------------------------------------------------------------
  35. Instructional Support Group (ISG), EECS email:inst@eecs.berkeley.edu
  36.  
  37. Ubuntu 14.04.1 LTS 3.13.0-45-generic.efi.signed
  38.  
  39. Host: hive25 SystemBuiltOn: 23Jan15-06:40
  40. ----------------------------------------------------------------------
  41. Last login: Sun Apr 26 15:01:14 2015 from c-24-130-80-223.hsd1.ca.comcast.net
  42.  
  43. 'cs61c-ev' is using 1178/2048 MB (57%) of its disk quota on /home/cc.
  44.  
  45. 'cs61c-ev' is using 0/20971 MB (0%) of its disk quota on /home/tmp.
  46.  
  47. (Type 'more /share/b/pub/disk.quotas' for more information.)
  48.  
  49.  
  50. (15:15:31 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  51. ~ $ ssh star
  52. ssh: connect to host star port 22: No route to host
  53.  
  54. (15:15:34 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  55. ~ $ ls
  56. cpu.circ lab11 proj2-ev-qb
  57. Desktop labs proj3-ev-qb
  58. Documents Library proj4-ev-qb
  59. Downloads linuxmint-17.1-cinnamon-64bit.iso Public
  60. files_for_submit logisim-generic-2.7.1.jar Templates
  61. hs_err_pid17501.log mozilla.pdf Videos
  62. hw5 Music work
  63. lab10 Pictures
  64.  
  65. (15:15:38 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  66. ~ $ proj4-ev-qb/^C
  67.  
  68. (15:15:40 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  69. ~ $ cd proj4-ev-qb/
  70.  
  71. (15:15:42 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  72. ~/proj4-ev-qb $ ls
  73. Makefile matrix-linear.log spark-cnn.log specs
  74. Makefrag-matrix matrix-nn.log spark-linear.log test
  75. Makefrag-spark matrix.py spark.log test-linear.log
  76. Makefrag-test snapshot spark-nn.log test.py
  77. matrix spark spark.py util
  78.  
  79. (15:15:43 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  80. ~/proj4-ev-qb $ ls
  81. Makefile Makefrag-spark matrix matrix-nn.log snapshot spark-cnn.log spark.log spark.py test test.py
  82. Makefrag-matrix Makefrag-test matrix-linear.log matrix.py spark spark-linear.log spark-nn.log specs test-linear.log util
  83.  
  84. (15:15:52 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  85. ~/proj4-ev-qb $ vim matrix
  86. matrix/ matrix-linear.log matrix-nn.log matrix.py
  87.  
  88. (15:15:52 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  89. ~/proj4-ev-qb $ vim matrix
  90. matrix/ matrix-linear.log matrix-nn.log matrix.py
  91.  
  92. (15:15:52 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  93. ~/proj4-ev-qb $ vim matrix
  94. matrix/ matrix-linear.log matrix-nn.log matrix.py
  95.  
  96. (15:15:52 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  97. ~/proj4-ev-qb $ vim matrix/linear.py
  98. linear.py linear.pyc
  99.  
  100. (15:15:52 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  101. ~/proj4-ev-qb $ vim matrix/linear.py
  102.  
  103. (15:20:00 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  104. ~/proj4-ev-qb $ ls
  105. Makefile Makefrag-spark matrix matrix-nn.log snapshot spark-cnn.log spark.log spark.py test test.py
  106. Makefrag-matrix Makefrag-test matrix-linear.log matrix.py spark spark-linear.log spark-nn.log specs test-linear.log util
  107.  
  108. (15:20:03 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  109. ~/proj4-ev-qb $ cd util
  110.  
  111. (15:20:06 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  112. ~/proj4-ev-qb/util $ ls
  113. build dump.py dump.pyc im2col.c im2col_c.c im2col_c.pyx im2col_c.so im2col.h im2col.py __init__.py __init__.pyc layers.py layers.pyc setup.py util.py util.pyc
  114.  
  115. (15:20:06 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  116. ~/proj4-ev-qb/util $ vim layers.py
  117.  
  118. (15:20:37 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  119. ~/proj4-ev-qb/util $ vim matc^C
  120.  
  121. (15:20:42 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  122. ~/proj4-ev-qb/util $ cd ..
  123.  
  124. (15:20:43 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  125. ~/proj4-ev-qb $ vim matrix
  126. matrix/ matrix-linear.log matrix-nn.log matrix.py
  127.  
  128. (15:20:43 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  129. ~/proj4-ev-qb $ vim matrix
  130. matrix/ matrix-linear.log matrix-nn.log matrix.py
  131.  
  132. (15:20:43 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  133. ~/proj4-ev-qb $ vim matrix/
  134. classifier.py cnn.py .gitignore __init__.pyc linear.pyc nn.py
  135. classifier.pyc cnn.pyc __init__.py linear.py .linear.py.swp nn.pyc
  136.  
  137. (15:20:43 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  138. ~/proj4-ev-qb $ vim matrix/linear.py
  139.  
  140. (15:24:48 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  141. ~/proj4-ev-qb $ vim util/
  142. build/ dump.pyc im2col.c im2col_c.pyx im2col.py __init__.pyc layers.pyc util.py
  143. dump.py .gitignore im2col_c.c im2col.h __init__.py layers.py setup.py util.pyc
  144.  
  145. (15:24:48 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  146. ~/proj4-ev-qb $ vim util/layers.py
  147.  
  148. (15:25:06 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  149. ~/proj4-ev-qb $ vim matrix/linear.py
  150.  
  151. (15:34:43 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  152. ~/proj4-ev-qb $ vim matrix/linear.py
  153.  
  154. (15:37:58 Sun Apr 26 2015 cs61c-ev@hive25 Linux x86_64)
  155. ~/proj4-ev-qb $ vim util/layers.py
  156.  
  157. df[g_ <= 0] = 0
  158. return df.reshape(g.shape)
  159.  
  160. def softmax_loss(f, Y):
  161. """
  162. * Coumputes the loss and its gradient for softmax classification
  163. Input:
  164. - f: [N * K] -> scores of N images for K classes
  165. - Y: [N * 1] -> labels of N images (range(0, K))
  166. Output:
  167. - L: softmax loss
  168. - df: gradient of L on f
  169. """
  170. N = f.shape[0]
  171.  
  172. # probs: [p_nk = exp(f_k_n) / sum(exp(f_j_n))]: [N * K]
  173. p = np.exp(f - np.max(f, axis=1, keepdims=True))
  174. p /= np.sum(p, axis=1, keepdims=True)
  175.  
  176. # loss: sum_n(-log(p_ny)) / N, where p_ny = prob of the image n's label
  177. L = np.sum(-np.log(p[np.arange(N), Y])) / N
  178.  
  179. # dL_n/df_k = p_k - delta_Y_n_k, where delta_Y_n_k = if (Y[n] == k) 1 else 0
  180. # gradient of L on f: dL/df = [dL_n/df_k / N]: [N * K]
  181. df = p.copy()
  182. df[np.arange(N), Y] -= 1
  183. df /= N
  184.  
  185. return L, df
  186.  
  187. def conv_forward(X, A, b, S, P):
  188. """
  189. Input:
  190. - X: [N * D * H * W] -> N image data of size D * H * W
  191. - A: [K * D * F * F] -> K filters of size D * F * F
  192. - b: [K * 1] -> bias
  193. - S: stride of convolution (integer)
  194. - P: size of zero padding (integer)
  195. Output:
  196. - f: [N * K * H_ * W_] -> activation maps, where
  197. - H_ = (H - F + 2P)/S + 1
  198. - W_ = (W - F + 2P)/S + 1
  199. - X_col: [(D * F * F) * (H_ * W_ * N)] -> column stretched images
  200. """
  201. 95,5 37%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement