一開始下載的conda package可能是比較舊的版本, 記得更新 Conda 像是pip 一樣可以管理lib, 不過不限於python lib, 也能裝非python lib, 另外numpy, scikit等lib 是使用pre-compiled 的 MKL 版本, 更快. 而且也可以管理虛擬環境, 就像是pyenv
$conda upgrade conda
| def create_placeholders(n_H0, n_W0, n_C0, n_y): | |
| """ | |
| Creates the placeholders for the tensorflow session. | |
| Arguments: | |
| n_H0 -- scalar, height of an input image | |
| n_W0 -- scalar, width of an input image | |
| n_C0 -- scalar, number of channels of the input | |
| n_y -- scalar, number of classes | |
| def conv_forward(A_prev, W, b, hparameters): | |
| """ | |
| Implements the forward propagation for a convolution function | |
| Arguments: | |
| A_prev -- output activations of the previous layer, numpy array of shape (m, n_H_prev, n_W_prev, n_C_prev) | |
| W -- Weights, numpy array of shape (f, f, n_C_prev, n_C) | |
| b -- Biases, numpy array of shape (1, 1, 1, n_C) | |
| hparameters -- python dictionary containing "stride" and "pad" | |
| def conv_single_step(a_slice_prev, W, b): | |
| """ | |
| Apply one filter defined by parameters W on a single slice (a_slice_prev) of the output activation | |
| of the previous layer. | |
| Arguments: | |
| a_slice_prev -- slice of input data of shape (f, f, n_C_prev) | |
| W -- Weight parameters contained in a window - matrix of shape (f, f, n_C_prev) | |
| b -- Bias parameters contained in a window - matrix of shape (1, 1, 1) | |
| import numpy as np | |
| def zero_pad(X, pad): | |
| """ | |
| Pad with zeros all images of the dataset X. The padding is applied to the height and width of an image, | |
| as illustrated in Figure 1. | |
| Argument: | |
| X -- python numpy array of shape (m, n_H, n_W, n_C) representing a batch of m images | |
| pad -- integer, amount of padding around each image on vertical and horizontal dimensions | |
| cp -a /source/. /dest/ | |
| References | |
| - https://askubuntu.com/questions/86822/how-can-i-copy-the-contents-of-a-folder-to-another-folder-in-a-different-directo |
一開始下載的conda package可能是比較舊的版本, 記得更新 Conda 像是pip 一樣可以管理lib, 不過不限於python lib, 也能裝非python lib, 另外numpy, scikit等lib 是使用pre-compiled 的 MKL 版本, 更快. 而且也可以管理虛擬環境, 就像是pyenv
$conda upgrade conda
| References | |
| - https://stackoverflow.com/questions/2389361/undo-a-git-merge-that-hasnt-been-pushed-yet | |
| $git reset --hard commit_sha |
| References | |
| - https://stackoverflow.com/questions/1376718/is-it-possible-to-retrieve-your-source-code-from-heroku | |
| $heroku login | |
| $heroku git:clone -a YOUR_APP_NAME | |
| $ cd YOUR_APP_NAME | |
| $git add . | |
| $ git commit -am "make it better" | |
| $ git push heroku master |
| References | |
| - https://stackoverflow.com/questions/2971550/how-to-push-different-local-git-branches-to-heroku-master | |
| git push heroku heroku-deploy-with-aws-setting:master |