Skip to content

Instantly share code, notes, and snippets.

View shijieyao's full-sized avatar
🎀
into the unknown

Shijie Yao shijieyao

🎀
into the unknown
  • Microsoft Azure
  • Minhang, Shanghai
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shijieyao
shijieyao / matplotlib_CJK.py
Created June 30, 2018 12:24
Display CJK (here an example of Japanese) in matplotlib
# title
import matplotlib.pyplot as plt
import matplotlib.font_manager
fontprop = matplotlib.font_manager.FontProperties(fname="/Users/shijieyao/Library/Fonts/ipam.ttc")
plt.plot([1,2,3])
plt.title(u"あいうえお", fontdict = {"fontproperties": fontprop})
#!/bin/bash
source venv/bin/activate
lang=$1
type=$2
experiment_id=$3
# theano device, in case you do not want to compute on gpu, change it to cpu
device=gpu0
basedir=.
#!/bin/bash
languages=( Japanese )
for lang in "${languages[@]}"
do
# for data set in data/languages/Latvian-20-char-context parameters are:
./train_change.sh ${lang} 30-char-context v1
# where v1 is an experiment identifier (can be any string)
done
#!/bin/sh
#To be used before srun so that interactive sessions are run with gpu support
#SBATCH -N 1 # nodes requested
#SBATCH -n 1 # tasks requested
#SBATCH --gres=gpu:1
#SBATCH --mem=16000 # memory in Mb
#SBATCH -o gpu_outfile # send stdout to sample_experiment_outfile
#SBATCH -e gpu_errfile # send stderr to sample_experiment_errfile
#SBATCH -t 8:00:00 # time requested in hour:minute:second
WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10). Please switch to the gpuarray backend. You can get more information about how to switch at this URL:
https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29
Using gpu device 0: GeForce GTX 1060 6GB (CNMeM is disabled, cuDNN None)
INFO: Loading data
INFO: Building model
INFO: Building sampler
INFO: Building f_init...
INFO: Done
INFO: Building f_next..