I hereby claim:
- I am hiraksarkar on github.
- I am hiraksarkar (https://keybase.io/hiraksarkar) on keybase.
- I have a public key whose fingerprint is 4152 B3E7 7BE1 83B0 1E53 8B80 2EDB 3721 028D 527A
To claim this, I am signing this object:
use ndarray::prelude::*; | |
fn std1d(a: ArrayView1<'_, f64>) -> f64 { | |
let n = a.len() as f64; | |
if n == 0. { | |
return 0.; | |
} | |
let mean = a.sum() / n; | |
(a.fold(0., |acc, &x| acc + (x - mean).powi(2)) / n).sqrt() | |
} |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/bash | |
tfile=$1 | |
usr=`rg "(\d+\.\d+)user" $tfile -or '$1'` | |
sys=`rg "(\d+\.\d+)system" $tfile -or '$1'` | |
elap=`rg "([\d:\.]+)elapsed" $tfile -or '$1'` | |
mem=`rg "(\d+)maxresident" $tfile -or '$1'` | |
tot_elap=`echo "$elap" | sed -E 's/(.*):(.+):(.+)/\1*3600+\2*60+\3/;s/(.+):(.+)/\1*60+\2/' | bc` |
plt.figure(figsize=(8, 8)) | |
df = np.log(variance_trio_df[['var_mean','merged_var']]+1) | |
df.loc[:,'color'] = 'b' | |
df.loc[(df.merged_var - df.var_mean) < -1, 'color'] = 'r' | |
colors = ["b", "r"] | |
customPalette = sns.set_palette(sns.color_palette(colors)) | |
ax = sns.scatterplot( | |
x = 'var_mean', | |
y = 'merged_var', | |
data = df, |
#!/bin/bash | |
## This gist contains instructions about cuda v11.2 and cudnn8.1 installation in Ubuntu 20.04 for Pytorch 1.8 & Tensorflow 2.7.0 | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### |
#!/bin/bash | |
#SBATCH --mincpus 16 | |
#SBATCH --mem 64G | |
#SBATCH --time 5:00:00 | |
#SBATCH --job-name mendel | |
#SBATCH --mail-type=begin # send email when job begins | |
#SBATCH --mail-type=end # send email when job ends | |
#SBATCH [email protected] | |
#SBATCH --output jupyter_logs/jupyter-notebook-%J.log | |
# get tunneling info |
#!/bin/bash | |
#SBATCH --mincpus 32 | |
#SBATCH --mem 100G | |
#SBATCH --time 6-23:59:00 | |
#SBATCH --job-name jupyterlab | |
#SBATCH --gres=gpu:1 | |
#SBATCH --mail-type=begin # send email when job begins | |
#SBATCH --mail-type=end # send email when job ends | |
#SBATCH [email protected] | |
#SBATCH --output jupyter_logs/jupyter-notebook-%J.log |
Installing R packages is painful, but conda environment solved a lot of problems. Basically, if you install your own R in conda, and the later R command install.packages()
will automatically install the packages in the environment; in addition, conda has many system libraries too for getting away from requiring sudo permissions.
After creating an empty conda environment, you can install a specific version (say 4.2) of R by conda install -c conda-forge r-essentials=4.2
. If you are not sure whether that version exists in conda, you can do conda search r-essentials
. Using your own R in the conda environment, you can do the normal R installation commands.
Some R packages search system libraries by pkg-config. After you install the required libraries through conda, you can check whether your PKG_CONFIG_PATH
includes /envs//lib/pkgconfig, and set the path properly.
mamba create -n r43 | |
mamba activate r43 | |
mamba install r-essentials=4.3 | |
mamba install r-rjags | |
export PKG_CONFIG_PATH=/home/user/miniconda3/envs/r43/lib/pkgconfig/:$PKG_CONFIG_PATH | |
# start R | |
R | |
# Install R package |