This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script will create a venv under as a `./venv` folder, and it will name it `my_new_venv_nickname_in_the_jupyter_menu` in jupyter's kernel list to choose the venv. | |
# You can edit the `./venv` path here to change it: | |
python3 -m venv ./venv | |
source ./venv/bin/activate | |
pip install --upgrade pip | |
pip install setuptools wheel | |
pip install ipykernel | |
# You can change the `my_new_venv_nickname_in_the_jupyter_menu` name in menu here: | |
ipython kernel install --user --name=my_new_venv_nickname_in_the_jupyter_menu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example output: | |
# .-'¯ _,.-'¯ _,.-'¯ _,.-'¯ _,.-'¯ | your message here |.,_ ¯'-.,_ ¯'-.,_ ¯'-.,_ ¯'-.,_ ¯ | |
# The things next to the message are animated and moving. | |
import time | |
import sys | |
import os | |
def wait(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import math | |
b = 8 | |
a = 2**b | |
x = np.array([[math.cos(0.5**i*x*2*math.pi) for x in range(0, a)] for i in range(1, b+1)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Simple second order optimization with TensorFlow.""" | |
import tensorflow as tf | |
#### | |
# 1. Define the problem |