#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
| #!/bin/sh | |
| sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common | |
| sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev | |
| sudo mkdir /usr/include/lua5.1/include | |
| sudo ln -s /usr/include/luajit-2.0 /usr/include/lua5.1/include | |
| cd ~ | |
| hg clone https://code.google.com/p/vim/ |
| require 'nn' | |
| require 'cutorch' | |
| require 'cunn' | |
| --[[ | |
| -- A simple benchmark comparing fully-connected net times on CPU and GPU. | |
| -- | |
| -- Note that we don't count time it takes to transfer data to the GPU. | |
| --]] |
| require 'torch' | |
| require 'cutorch' | |
| require 'nn' | |
| require 'cunn' | |
| require 'cudnn' | |
| local N = 32 | |
| local cin = 64 | |
| local cout = 64 | |
| local height = 256 |
#Create bitbucket branch
##Create local branch
$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
master
* sync
| import numpy as np | |
| import bottleneck as bn | |
| def top_n_indexes(arr, n): | |
| idx = bn.argpartsort(arr, arr.size-n, axis=None)[-n:] | |
| width = arr.shape[1] | |
| return [divmod(i, width) for i in idx] | |
| np.random.seed(47) |
| # null.py | |
| import numpy as np | |
| from scipy.linalg import qr | |
| def qr_null(A, tol=None): | |
| Q, R, P = qr(A.T, mode='full', pivoting=True) | |
| tol = np.max(A) * np.finfo(R.dtype).eps if tol is None else tol | |
| rnk = min(A.shape) - np.abs(np.diag(R))[::-1].searchsorted(tol) | |
| return Q[:, rnk:].conj() |
| import jax | |
| import jax.numpy as np | |
| from jax import grad, jit | |
| from jax.scipy.special import logsumexp | |
| def dadashi_fig2d(): | |
| """ Figure 2 d) of | |
| ''The Value Function Polytope in Reinforcement Learning'' | |
| by Dadashi et al. (2019) https://arxiv.org/abs/1901.11524 |