In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# ssh into a machine and automatically set the background | |
# color of Mac OS X Terminal depending on the hostname. | |
# | |
# Installation: | |
# 1. Save this script to /usr/local/bin/ssh-host-color | |
# 2. chmod 755 /usr/local/bin/ssh-host-color | |
# 3. alias ssh=/usr/local/bin/ssh-host-color | |
# 4. export PRODUCTION_HOST="<hostname_production_server>" |
Starting from version 1.5, OpenFst has offered a native Python module, making the use of external wrappers like PyFst unnecessary. This has been greatly helpful since PyFst doesn't support Python 3.
- Download OpenFst 1.5.4 or above from http://openfst.cs.nyu.edu/twiki/bin/view/FST/FstDownload
- Unzip, untar:
$ tar xzvf openfst-1.5.4.tar.gz
$ ./configure --enable-python --enable-far
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import random, choice | |
def noise_generator(string, noise_level, chars): | |
noised = "" | |
for c in string: | |
if random() > noise_level: | |
noised += c | |
if random() < noise_level: | |
noised += choice(chars) | |
return noised |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
from tensorflow.contrib.rnn import RNNCell | |
from tensorflow.contrib.rnn import LSTMStateTuple | |
from tensorflow.python.ops import variable_scope | |
from tensorflow.python.ops import array_ops | |
from tensorflow.python.ops.rnn_cell_impl import _linear | |
from tensorflow.python.ops import math_ops | |
from tensorflow.python.ops import nn_ops | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WARNING: These steps seem to not work anymore! | |
#!/bin/bash | |
# Purge existign CUDA first | |
sudo apt --purge remove "cublas*" "cuda*" | |
sudo apt --purge remove "nvidia*" | |
# Install CUDA Toolkit 10 | |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb |