Skip to content

Instantly share code, notes, and snippets.

View shashankg7's full-sized avatar

Shashank Gupta shashankg7

View GitHub Profile
@shashankg7
shashankg7 / distributed_dalle2_laion.md
Created September 18, 2024 23:33 — forked from rom1504/distributed_dalle2_laion.md
distributed dalle2 laion
@shashankg7
shashankg7 / extract_ILSVRC.sh
Created August 26, 2024 01:54 — forked from BIGBALLON/extract_ILSVRC.sh
script for ImageNet data extract.
#!/bin/bash
#
# script to extract ImageNet dataset
# ILSVRC2012_img_train.tar (about 138 GB)
# ILSVRC2012_img_val.tar (about 6.3 GB)
# make sure ILSVRC2012_img_train.tar & ILSVRC2012_img_val.tar in your current directory
#
# https://github.com/facebook/fb.resnet.torch/blob/master/INSTALL.md
#
# train/
@shashankg7
shashankg7 / extract_ILSVRC.sh
Created August 26, 2024 01:54 — forked from BIGBALLON/extract_ILSVRC.sh
script for ImageNet data extract.
#!/bin/bash
#
# script to extract ImageNet dataset
# ILSVRC2012_img_train.tar (about 138 GB)
# ILSVRC2012_img_val.tar (about 6.3 GB)
# make sure ILSVRC2012_img_train.tar & ILSVRC2012_img_val.tar in your current directory
#
# https://github.com/facebook/fb.resnet.torch/blob/master/INSTALL.md
#
# train/
@shashankg7
shashankg7 / TopicModelZoo.md
Created April 2, 2020 21:04 — forked from scapegoat06/TopicModelZoo.md
Topic Model Zoo
@shashankg7
shashankg7 / lda.py
Created August 24, 2017 19:54 — forked from alextp/lda.py
import numpy as np
def symdirichlet(alpha, n):
v = np.zeros(n)+alpha
return np.random.dirichlet(v)
def exp_digamma(x):
if x < 0.1:
return x/100
@shashankg7
shashankg7 / sklearn_classif_report_to_latex.py
Created April 22, 2017 09:37 — forked from julienr/sklearn_classif_report_to_latex.py
Parse and convert scikit-learn classification_report to latex
"""
Code to parse sklearn classification_report
"""
##
import sys
import collections
##
def parse_classification_report(clfreport):
"""
Parse a sklearn classification report into a dict keyed by class name
@shashankg7
shashankg7 / springer-free-maths-books.md
Created February 23, 2017 17:26 — forked from bishboria/springer-free-maths-books.md
Springer made a bunch of books available for free, these were the direct links
@shashankg7
shashankg7 / preprocess-twitter.py
Created December 28, 2016 09:30 — forked from tokestermw/preprocess-twitter.py
Python version of Ruby script to preprocess tweets for use in GloVe featurization http://nlp.stanford.edu/projects/glove/
"""
preprocess-twitter.py
python preprocess-twitter.py "Some random text with #hashtags, @mentions and http://t.co/kdjfkdjf (links). :)"
Script for preprocessing tweets by Romain Paulus
with small modifications by Jeffrey Pennington
with translation to Python by Motoki Wu
Translation of Ruby script to create features for GloVe vectors for Twitter data.
@shashankg7
shashankg7 / ngram_cnn.py
Created September 20, 2016 15:34 — forked from joshloyal/ngram_cnn.py
Convolutional Network for Sentence Classification (Keras)
from keras.models import Graph
from keras.layers import containers
from keras.layers.core import Dense, Dropout, Activation, Reshape, Flatten
from keras.layers.embeddings import Embedding
from keras.layers.convolutional import Convolution2D, MaxPooling2D
def ngram_cnn(n_vocab, max_length, embedding_size, ngram_filters=[2, 3, 4, 5], n_feature_maps=100, dropout=0.5, n_hidden=15):
"""A single-layer convolutional network using different n-gram filters.
Parameters
@shashankg7
shashankg7 / rank_metrics.py
Created September 6, 2016 11:23 — forked from bwhite/rank_metrics.py
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np