Skip to content

Instantly share code, notes, and snippets.

Shijie shijieyao

  • UoE, Edinburgh, UK
Block or report user

Report or block shijieyao

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@shijieyao
shijieyao / matplotlib_CJK.py
Created Jun 30, 2018
Display CJK (here an example of Japanese) in matplotlib
View matplotlib_CJK.py
# 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})
View train_change.sh
#!/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=.
View char30.sh
#!/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
View run30.sh
#!/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
View error_training.log
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..
You can’t perform that action at this time.