MATLAB's for
loop iterates over columns, not individual elements. I've tripped over this too many times.
Consider a matrix.
A = magic(3)
A = ...
8 1 6
sudo apt-get install build-essential | |
sudo apt-get update | |
# BLAS → LAPACK → ATLAS → numpy → scipy → Theano | |
# remove numpy and scipy | |
sudo apt-get remove python-numpy | |
sudo apt-get remove python-scipy | |
# Instalation commands | |
sudo apt-get install gfortran | |
sudo apt-get install libopenblas-dev | |
sudo apt-get install liblapack-dev |
# install dependencies | |
sudo apt-get update | |
sudo apt-get install -y build-essential | |
sudo apt-get install -y cmake | |
sudo apt-get install -y libgtk2.0-dev | |
sudo apt-get install -y pkg-config | |
sudo apt-get install -y python-numpy python-dev | |
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev | |
sudo apt-get install -y libjpeg-dev libpng-dev libtiff-dev libjasper-dev | |
import tensorflow as tf | |
import numpy as np | |
import time | |
N=10000 | |
K=4 | |
MAX_ITERS = 1000 | |
start = time.time() |
MATLAB's for
loop iterates over columns, not individual elements. I've tripped over this too many times.
Consider a matrix.
A = magic(3)
A = ...
8 1 6
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
$ vi /etc/sysctl.conf | |
# 系统所有进程一共可以打开的文件数量, 每个套接字也占用一个文件描述字 | |
fs.file-max = 1491124 | |
# 系统同时保持TIME_WAIT套接字的最大数目,http 短链接会产生很多 TIME_WAIT 套接字。 | |
net.ipv4.tcp_max_tw_buckets = 7000 | |
# 关闭 tcp 来源跟踪 | |
net.ipv4.conf.default.accept_source_route = 0 | |
# 缩短套接字处于 TIME_WAIT 的时间, 60s -> 30s | |
net.ipv4.tcp_fin_timeout = 30 | |
# 启用 TIME_WAIT 复用,使得结束 TIEM_WAIT 状态的套接字的端口可以立刻被其他套接字使用。 |