Skip to content

Instantly share code, notes, and snippets.

View raivivek's full-sized avatar
👋

Vivek Rai raivivek

👋
View GitHub Profile
@raivivek
raivivek / theme_ms.R
Created June 12, 2018 19:56 — forked from wpetry/theme_ms.R
ggplot2 theme for publication figures
library(ggplot2)
library(grid)
# define consistent ggplot theme to apply to all figures
theme_ms <- function(base_size=12, base_family="Helvetica") {
library(grid)
(theme_bw(base_size = base_size, base_family = base_family)+
theme(text=element_text(color="black"),
axis.title=element_text(face="bold", size = rel(1.3)),
axis.text=element_text(size = rel(1), color = "black"),
legend.title=element_text(face="bold"),
@raivivek
raivivek / fast_ai_mooc_important_points.md
Created March 4, 2019 16:31 — forked from bhavikngala/fast_ai_mooc_important_points.md
This gist contains a list of important points from fast.ai "practical deep learning for coders" and "cutting edge deep learning for coders" MOOC

This gist contains a list of points I found very useful while watching the fast.ai "Practical deep learning for coders" and "Cutting edge deep learning for coders" MOOC by Jeremy Howard and team. This list may not be complete as I watched the video at 1.5x speed on marathon but I did write down as many things I found to be very useful to get a model working. A fair warning the points are in no particular order, you may find the topics are all jumbled up.

Before beginning, I want to thank Jeremy Howard, Rachel Thomas, and the entire fast.ai team in making this awesome practically oriented MOOC.

  1. Progressive image resolution training: Train the network on lower res first and then increase the resolution to get better performance. This can be thought of as transfer learning from the same dataset but at a different resolution. There is one paper by NVIDIA as well that used such an approach to train GANs.

  2. Cyclical learning rates: Gradually increasing the learning rate initially helps to avoid getting stuc

Bedtools Cheatsheet

General:

Tools Description
flank Create new intervals from the flanks of existing intervals.
slop Adjust the size of intervals.
shift Adjust the position of intervals.
subtract Remove intervals based on overlaps b/w two files.
@raivivek
raivivek / Kobo Reader Highlights & Annotations
Created December 31, 2019 03:27 — forked from ozgurkalan/Kobo Reader Highlights & Annotations
Kobo eReader - KoboReader.sqlite - SQL statement for listing books, highlights and annotations per chapter
'''''list highlights and annotations by ISBN and book:
select
ISBN, title,
text, annotation
from bookmark
left outer join content
on (content.contentID=bookmark.VolumeID and content.ContentType=6)
where
text is not null;
@raivivek
raivivek / wayback.py
Created June 22, 2020 06:01 — forked from wcaleb/wayback.py
Pandoc filter to replace Link URLs with Wayback Machine URLs
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
# Usage: pandoc --filter=wayback.py input
# Install pandocfilters and requests with pip before using
# Warning: may take a while to process input with lots of links
# Note: Links that can't be saved to WBM or already point to WBM are left as is
from pandocfilters import toJSONFilter, Link
import requests
@raivivek
raivivek / slope_vs_starting.md
Created August 14, 2021 20:06 — forked from gtallen1187/slope_vs_starting.md
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]

@raivivek
raivivek / bash-snippets.md
Created December 21, 2021 01:35 — forked from putnamhill/bash-snippets.md
bash snippets - these are mostly just notes for myself; some I've found and some I've made

git

list files in another branch

git ls-files --with-tree=another-branch

grep through all revisions of a repo

git grep -B1 -A2 AWSLambdaBasicExecutionRole $(git rev-list --all) -- *.tf