git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| # Assuming an Ubuntu Docker image | |
| $ docker run -it <image> /bin/bash |
| import numpy as np | |
| from keras.models import Sequential | |
| from keras.layers.core import Activation, Dense | |
| training_data = np.array([[0,0],[0,1],[1,0],[1,1]], "float32") | |
| target_data = np.array([[0],[1],[1],[0]], "float32") | |
| model = Sequential() | |
| model.add(Dense(32, input_dim=2, activation='relu')) | |
| model.add(Dense(1, activation='sigmoid')) |
| #!/bin/bash | |
| # install CUDA Toolkit v8.0 | |
| # instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network)) | |
| CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb" | |
| wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG} | |
| sudo dpkg -i ${CUDA_REPO_PKG} | |
| sudo apt-get update | |
| sudo apt-get -y install cuda |
| def ransac_polyfit(x, y, order=3, n=20, k=100, t=0.1, d=100, f=0.8): | |
| # Thanks https://en.wikipedia.org/wiki/Random_sample_consensus | |
| # n – minimum number of data points required to fit the model | |
| # k – maximum number of iterations allowed in the algorithm | |
| # t – threshold value to determine when a data point fits a model | |
| # d – number of close data points required to assert that a model fits well to data | |
| # f – fraction of close data points required | |
| besterr = np.inf |
The PATH is an important concept when working on the command line. It's a list
of directories that tell your operating system where to look for programs, so
that you can just write script instead of /home/me/bin/script or
C:\Users\Me\bin\script. But different operating systems have different ways to
add a new directory to it:
| def seed_everything(seed: int): | |
| import random, os | |
| import numpy as np | |
| import torch | |
| random.seed(seed) | |
| os.environ['PYTHONHASHSEED'] = str(seed) | |
| np.random.seed(seed) | |
| torch.manual_seed(seed) | |
| torch.cuda.manual_seed(seed) |
| # Add the following records to your DNS config | |
| ## Mac: /etc/hosts | |
| ## Windows: C:\Windows\System32\drivers\etc\hosts | |
| 104.18.23.110 admin-stg.notion.so | |
| 104.18.23.110 aif.notion.so | |
| 104.18.23.110 analytics-iframe.notion.so | |
| 104.18.23.110 analytics.pgncs.notion.so | |
| 104.18.23.110 api.notion.so | |
| 104.18.23.110 api.pgncs.notion.so | |
| 104.18.23.110 dev.notion.so |