Ubuntu 14.04 LTS desktop amd64
GeForce GTX 750 Ti
ASRock Z170M Pro4S [Intel Z170chipset]
TensorFlow v0.11
cuDNN v5.1 for Linux
CUDA v7.5
Python 2.7.6
IPython 5.1.0 -- An enhanced Interactive Python.
Jupyter(IPython) NotebookのTutorial
https://www.youtube.com/watch?v=LNncYkzetJg&index=3&list=PLRJx8WOUx5Xd3_dgw5xRmABUd8MWdsA_C
6:02頃
%timeit range(100)
%timeit range(100)
上記でShift+Enter(Run Cells)すると処理時間が表示される。
The slowest run took 4.85 times longer than the fastest. This could mean that an intermediate result is being cached. 1000000 loops, best of 3: 393 ns per loop
%%timeit のあとに複数の実行文
%%timeit
for x in range(100):
y=x+1
The slowest run took 18.90 times longer than the fastest. This could mean that an intermediate result is being cached. 1000000 loops, best of 3: 1.98 µs per loop
%%timeitの練習
%%timeit
sum=0
i=0
while i<=100000:
sum+=i
i+=1
100 loops, best of 3: 3.01 ms per loop
%%timeit
sum=0
for i in xrange(100001):
sum+=i
1000 loops, best of 3: 1.64 ms per loop
%%timeit
sum(xrange(100001))
1000 loops, best of 3: 526 µs per loop