Skip to content

Instantly share code, notes, and snippets.

@thanhnguyentang
thanhnguyentang / rl_refs.bib
Last active July 3, 2022 17:18
Bib refs for RL works
@inproceedings{tripuraneni2021provable,
title={Provable meta-learning of linear representations},
author={Tripuraneni, Nilesh and Jin, Chi and Jordan, Michael},
booktitle={International Conference on Machine Learning},
pages={10434--10443},
year={2021},
organization={PMLR}
}
@inproceedings{mitchell2021offline,
@thanhnguyentang
thanhnguyentang / Latex_free_style_template.tex
Last active June 25, 2022 12:18
Latex_free_style_template
\usepackage[a4paper,top=3cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
\usepackage[utf8]{inputenc} % allow utf-8 input
\usepackage[T1]{fontenc} % use 8-bit T1 fonts
\usepackage[colorlinks=true,linkcolor=blue,citecolor=blue]{hyperref}
\usepackage{url} % simple URL typesetting
\usepackage{booktabs} % professional-quality tables
\usepackage{amsfonts} % blackboard math symbols
\usepackage{nicefrac} % compact symbols for 1/2, etc.
\usepackage{microtype} % microtypography
@thanhnguyentang
thanhnguyentang / basic_ubuntu_package_install.sh
Created October 2, 2018 10:35
basic_ubuntu_package_install.sh
# INSTALL MISSING PACKAGE
sudo apt -f install
# INSTAL CHROME
sudo apt-get install libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb
# VSCODE
wget https://az764295.vo.msecnd.net/stable/f46c4c469d6e6d8c46f268d1553c5dc4b475840f/code_1.27.2-1536736588_amd64.deb
@thanhnguyentang
thanhnguyentang / min-char-rnn.py
Created May 3, 2016 13:39 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
echo "Removing any pre-installed ffmpeg and x264"
sudo apt-get -qq remove ffmpeg x264 libx264-dev
echo "Updating and Instaling dependencies"
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential git libjpeg-dev libpng-dev libtiff5-dev libjpeg8-dev libjasper-dev libpng12-dev libavcodec-dev libavformat-dev libswscale-dev pkg-config cmake libgtk2.0-dev libeigen3-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev sphinx-common libtbb-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libopenexr-dev libgstreamer-plugins-base1.0-dev libavutil-dev libavfilter-dev libavresample-dev libatlas-base-dev gfortran libv4l-dev
echo "Setting up the build"
mkdir release
echo "Removing any pre-installed ffmpeg and x264"
sudo apt-get -qq remove ffmpeg x264 libx264-dev
echo "Updating and Instaling dependencies"
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential git libjpeg-dev libpng-dev libtiff5-dev libjpeg8-dev libjasper-dev libpng12-dev libavcodec-dev libavformat-dev libswscale-dev pkg-config cmake libgtk2.0-dev libeigen3-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev sphinx-common libtbb-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libopenexr-dev libgstreamer-plugins-base1.0-dev libavutil-dev libavfilter-dev libavresample-dev libatlas-base-dev gfortran libv4l-dev
echo "Setting up the build"
mkdir release
MAXIMUM-SUBARRAY(A, low, high)
sum = A[low]
left_index = low
right_index = low
right_sum = A[low]
start_index = low
for i = low+1 to high
if right_sum > 0
BUBBLE-SORT(A)
// repeatedly swap two adjacent elements that are out of order
for i = 1 to A.length() - 1
for j = A.length down to i+1
if A[j] < A[j-1]
swap(A[j], A[j-1])
MERGE(A,p,q,r)
// Merges 2 sorted arrays into a single sorted array
// where A[p..q] and A[q..r] are sorted subarrays.
n1 = q - p + 1
n2 = r - q
let L[1..n1+1], R[1..n2+1] be new arrays
for i = 1 to n1
INSERTION-SORT(A)
for j = 2 to A.length
key = A[j]
// insert key into the sorted sequence A[1..j-1]
i = j - 1
while i > 0 and A[i] > key
A[i+1] = A[i]
i = i - 1
A[i+1] = key