Instantly share code, notes, and snippets.

Hirak Sarkar hiraksarkar

Created March 5, 2024 15:29
ggdump example
This file contains 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
 library(ggplot2) library(dplyr) library(ggbump) tmp.subset = lr_df_merged %>% filter(ligand %in% c('WNT9A','ARTN', 'ANGPTL2') ) tmp.subset = tmp.subset |> arrange(ligand,desc(copula_coeff)) to_nodes = distinct(tmp.subset, receptor) |> mutate(to_y = row_number()) num_senders = (distinct(tmp.subset, ligand) %>% dim)[[1]] from_nodes = distinct(tmp.subset, ligand) |> mutate(from_y = round(dim(to_nodes)[[1]])/(num_senders+1) + row_number()-1+0.5)
Last active December 12, 2023 17:29
ML guided tour

Step 0

• Math4ML video playlist
• Deep Learning foundation and concept book Chapter 1-3

Regression and Statistics

The main proofs are to be read from the following order

Created December 12, 2023 17:03
Deep Learning Guided Tour

Given the two recent books are out the best is to use them iteratively. I am not gonna add the book by Murphy as I find it not to be self sufficient but rather regard it as a dictionary. Main books

• Understanding deep learning by Prince book and notebook
• Deep Learning foundation and concept book

Murphy's book for reference

• Probabilistic Machine Learning: Advanced Topics book
Last active December 12, 2023 17:03
Regression book tour with proofs and code

The main proofs are to be read from the following order -- Proofs are given here https://www.statlect.com/fundamentals-of-statistics/ It should be accompanied by the econometrics lecture given here and here

These can be accompanied by the following books

• Foundations of Statistics for Data Scientists R and Python by Agresti and Kateri
• Introductory Econometrics: A Modern Approach by Woodridge

For algorithmic treatment that talks about efficient mechanisms to optimize consult

Created September 14, 2023 04:50
Install infercnv in conda
This file contains 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
 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
Last active January 21, 2024 21:13
R_installation_instruction within conda

Basic

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.

Last active September 19, 2023 20:31
cycles slurm job
This file contains 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 #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 --mail-user=hs0424@princeton.edu #SBATCH --output jupyter_logs/jupyter-notebook-%J.log
Created September 9, 2023 16:54
della slurm jupyter job submission
This file contains 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 #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 --mail-user=hs0424@princeton.edu #SBATCH --output jupyter_logs/jupyter-notebook-%J.log # get tunneling info
Created December 6, 2021 23:34 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
CUDA 11.2 Installation on Ubuntu 20.04
This file contains 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 ## 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 ###
Last active March 13, 2021 16:40
Quick intro to using colab virtual machine for quick GPU access

Note

I have changed only two directory names from the original post to be found here

Open account with ngrok.com

Get the `autorization code` after creating a free account with `ngork`. You will meet with a screen like following