Skip to content

Instantly share code, notes, and snippets.

View trungkak's full-sized avatar

Trung Lê Hoàng trungkak

View GitHub Profile
@trungkak
trungkak / tf.sh
Created November 23, 2017 21:09
Tensorflow GPU installation on Ubuntu 16.04
# 1. Install CUDA
# Preparation
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install tmux build-essential gcc g++ make binutils
sudo apt-get install software-properties-common
# Download Cuda toolkit (Nvidia driver included)
cd ~/Downloads
# Download CUDA 8.0 from this https://developer.nvidia.com/cuda-80-ga2-download-archive, not 9.0
@smddzcy
smddzcy / Solution.java
Created October 8, 2016 21:33
Very simple Graph implementation in Java
private static class Vertex {
private int uniqueLabel;
public Vertex(int uniqueLabel) {
super();
this.uniqueLabel = uniqueLabel;
}
@Override
public boolean equals(Object obj) {
@pannous
pannous / hello_sequence.py
Last active March 22, 2018 17:59
Simple "Hello World" for tensorflow seq2seq model
"""Sequence-to-sequence model with an attention mechanism."""
# see https://www.tensorflow.org/versions/r0.10/tutorials/seq2seq/index.html
# compare https://github.com/tflearn/tflearn/blob/master/examples/nlp/seq2seq_example.py
from __future__ import print_function
import numpy as np
import tensorflow as tf
vocab_size=256 # We are lazy, so we avoid fency mapping and just use one *class* per character/byte
target_vocab_size=vocab_size
learning_rate=0.1
@karpathy
karpathy / min-char-rnn.py
Last active April 28, 2025 17:51
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)
@thotmx
thotmx / install_chrome_driver
Created March 21, 2015 06:12
Install chromedriver in Ubuntu (14.04)
$ sudo apt-get install chromium-chromedriver
$ sudo ln -s /usr/lib/chromium-browser/chromedriver /usr/bin/chromedriver
@julionc
julionc / 00.howto_install_phantomjs.md
Last active March 24, 2025 17:27
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@ttezel
ttezel / gist:4138642
Last active July 27, 2024 14:46
Natural Language Processing Notes

#A Collection of NLP notes

##N-grams

###Calculating unigram probabilities:

P( wi ) = count ( wi ) ) / count ( total number of words )

In english..