Skip to content

Instantly share code, notes, and snippets.

View floringogianu's full-sized avatar
🐳
Chasing Moby-Dick

Florin Gogianu floringogianu

🐳
Chasing Moby-Dick
View GitHub Profile
@floringogianu
floringogianu / gist:384cbbe9adf7e64f505b67a20c39c146
Created April 9, 2016 18:54 — forked from akolosov/gist:cedaac86b333a4ced95f
vim 7.4 with lua+GUI on Ubuntu 14.04
#!/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/
@floringogianu
floringogianu / fc_benchmark.lua
Created April 20, 2016 11:09 — forked from jcjohnson/fc_benchmark.lua
Simple torch benchmarking tool for fully-connected networks
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
@floringogianu
floringogianu / gist:38f54d01ff46d11aef0e48377d213c4d
Created November 27, 2017 15:28 — forked from tomerfiliba/gist:3698403
get the indexes of the top n elements in a numpy 2d-array
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)
@floringogianu
floringogianu / null.py
Created December 8, 2017 15:53 — forked from fish830617/null.py
Calculate the null space of a matrix by QR factorization.
# 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()
@floringogianu
floringogianu / Deep-Recurrent-Q-Network.ipynb
Created August 8, 2018 09:16 — forked from awjuliani/Deep-Recurrent-Q-Network.ipynb
An implementation of a Deep Recurrent Q-Network in Tensorflow.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@floringogianu
floringogianu / bibtex.png
Created August 13, 2018 12:02 — forked from max-mapper/bibtex.png
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@floringogianu
floringogianu / exact_pg.py
Created July 18, 2019 06:24 — forked from pierrelux/exact_pg.py
Exact Policy Gradient in jax, demonstrated in figure 2d of Dadashi et al. (2019)
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
@floringogianu
floringogianu / matplotlib Border Removal.ipynb
Created June 6, 2020 13:22 — forked from kylemcdonald/matplotlib Border Removal.ipynb
How to (mostly) remove all borders and padding with matplotlib.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.