Thursday, December 7, 2017

Deep Residual Network

https://github.com/KaimingHe/deep-residual-networks

Convolutional Neural Networks


A Beginner's Guide To Understanding Convolutional Neural Networks

https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/

https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks-Part-2/

https://adeshpande3.github.io/adeshpande3.github.io/The-9-Deep-Learning-Papers-You-Need-To-Know-About.html

Thursday, October 12, 2017

Tmux capture the history message

To scroll back tmux history, run
Control + B, then PageUp or PageD 

Alternatively, we can also capture the history to a file by executing tmux capture-pane command in another pane:

tmux capture-pane -S -2000 -J -p -t %123 >tmux.log

Where %123 is the unique pane id. To find out the pane id, run the following command inside a target pane:
echo $TMUX_PANE

See man tmux for other parameters.

Wednesday, October 4, 2017

Running graphic programs on Windows 10 Subsystem on Linux

To run graphical programs on Windows 10 bash shell, an X server (eg, Xming, vcXsrv and Cygwin X) will need to be installed on the Windows 10 system and the DISPLAY variable will need to be set in Bash.

To set DISPLAY variable,
export DISPLAY=:0
Then try running a graphic program, such as,
xclock

Tuesday, September 26, 2017

Compile with hdf5 support on ubuntu

 
(1) fatal error: hdf5.h: No such file or directory
 
Solution:
Search the header file by 
find /usr -iname "*hdf5.h*"
/usr/include/hdf5/serial/hdf5.h
Then,
export CPATH="/usr/include/hdf5/serial/"
 
(2) /usr/bin/ld: cannot find -lhdf5
 
Solution:
cd /usr/lib/x86_64-linux-gnu
ln -s libhdf5_serial.so libhdf5.so

Reference:
https://github.com/BVLC/caffe/issues/2347
https://github.com/NVIDIA/DIGITS/issues/156

Wednesday, August 2, 2017

Quick intro to git and github

http://hplgit.github.io/teamods/bitgit/._Langtangen_bitgit-bootstrap004.html

Collaborative development using github
https://dev.acquia.com/blog/getting-started-collaborative-development-git

Tuesday, August 1, 2017

Install extra fonts on top of basic texlive installation

tlmgr install collection-fontsrecommended collection-fontsextra

LaTeX errors found: ! LaTeX Error: File `inconsolata.sty' not found.

The following solution is copied from https://stackoverflow.com/questions/34524357/inconsolata-missing-to-build-r-vignette

Installing texlive-fonts-extra should take care of it.
You can also (though probably not recommented) tell R not to use inconsolata. Just change:
\DeclareOption{inconsolata}{\setboolean{Rd@use@inconsolata}{true}}
to
\DeclareOption{inconsolata}{\setboolean{Rd@use@inconsolata}{false}}
in your Rd.sty file. On my installation it is at :
/usr/share/R/share/texmf/tex/latex/Rd.sty
but a
locate Rd.sty
should find it on any system.

Thursday, July 20, 2017

R environment topic collections

1) "Advanced R" by Hadley Wickham
http://adv-r.had.co.nz/Environments.html
2) "Environments in R" by Christopher Bare
https://www.r-bloggers.com/environments-in-r/

Thursday, June 22, 2017

R package openxlsx for reading xlsx file

read.xlsx(xlsxFile, sheet = 1, startRow = 1, colNames = TRUE,
rowNames = FALSE, detectDates = FALSE, skipEmptyRows = TRUE,
skipEmptyCols = TRUE, rows = NULL, cols = NULL, check.names = FALSE,
namedRegion = NULL, na.strings = "NA", fillMergedCells = FALSE)

Sunday, June 11, 2017

Ubuntu locale

apt-get install locales
locale-gen --purge en_US.UTF-8

Friday, June 9, 2017

Singularity Ubuntu Image Creation and Use

#Step 1, install singularity (See http://singularity.lbl.gov/)

#Step 2, create a spec file named "Singularity" with content:
Bootstrap:docker
From:ubuntu:latest
%post
    apt-get update

    apt-get -y install openssh-server
    apt-get -y install openssh-client
    apt-get -y install build-essential
    apt-get -y install less
    apt-get -y install nano
    apt-get -y install locales
    locale-gen --purge en_US.UTF-8

    mkdir /cluster001
%environment 

    export LC_ALL=C.UTF-8
    export LANG=C.UTF-8


#The commands below %post are used to install or set up system after bootstrap.

#Step3, create an ubuntu image in folder ~/Container
singularity create ~/Container/ubuntu.img

#Step 4, run bootstrap command with sudo to ensure proper file ownership/permission
sudo singularity bootstrap ~/Container/ubuntu.img Singularity

#Content creation
#Method 1: copy a file to container
singularity copy ubuntu.img -p script1.sh /bin
#to copy with sudo and maintain proper root ownership
chmod 775 script2.sh
sudo chown root script2.sh
sudo singularity copy ubuntu.img -p script2.sh /bin

#check ownership
singularity exec ~/Container/ubuntu.img ls -l /bin/script*.sh

#Method 2, shell into image with --writable and then issue any kind of content creation, or download using wget or curl or git clone, etc.
#For example, run interactive with sudo to install R (note 1):
sudo singularity shell --writable ~/Container/ubuntu.img
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
apt-get install software-properties-common
add-apt-repository 'deb [arch=amd64] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
apt-get update
apt-get install r-base

#Run interactive shell as an user
singularity shell --writable ~/Container/ubuntu.img

#Increase container size in unit of MB if the default size is not big enough
singularity expand --size 2048 ~/Container/ubuntu.img


#Execute command through singularity image, eg run "ls -l /bin/":
singularity exec ~/ubuntu.img ls -l /bin/

Note 1: https://www.digitalocean.com/community/tutorials/how-to-install-r-on-ubuntu-16-04-2

Sunday, May 28, 2017

Merge PDF files using ghostscript

To combine multiple pdf files in a given order:

gswin64.exe -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=Merged.pdf -dBATCH 1.pdf 2.pdf 3.pdf

To import pdf file names from a text file (space separated file names):

gswin64.exe -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=Merged.pdf -dBATCH @filelist.txt

Thursday, January 5, 2017

Standard deviation of ratio






This image is derived from "A biologist's guide to statistical thinking and analysis" by David S. Fay and Ken Gerow (http://www.wormbook.org/chapters/www_statisticalanalysis/statisticalanalysis.html).

Note that num and den each have multiple replicates.