Skip to content

Instantly share code, notes, and snippets.

@pbamotra
pbamotra / Install NVIDIA Driver and CUDA.md
Created February 14, 2018 20:10 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@pbamotra
pbamotra / scrape_npr.py
Created December 6, 2017 23:14
Download <date><topic><news title> for NPR from Oct 29, 2019 through present
# -*- coding: utf-8 -*-
import os
import sys
import grequests
import numpy as np
import pandas as pd
from lxml import html
from time import sleep
from datetime import date, timedelta
@pbamotra
pbamotra / iclr18-ranking-by-replies.sh
Last active November 29, 2017 21:22
List of ICLR 2018 submissions ranked by number of replies
# requirements: curl, jq, python, pandas
# brew install jq
# pip install pandas
# prints top 50 papers
curl -sS "https://openreview.net/notes?invitation=ICLR.cc%2F2018%2FConference%2F-%2FBlind_Submission&offset=0&limit=5000" | jq -r '.notes[] | .content.title + "\t" + (.replyCount|tostring)' > subset.tsv && python -c 'from pprint import pprint; import pandas as pd; d=pd.read_csv("subset.tsv", header=None, delimiter="\t"); d.columns=["title", "replies"]; pprint(d.sort_values(by="replies", ascending=False).head(50).title.tolist());' && rm -f subset.tsv
# number of papers in top 50 on adversarial networks
@kaushikpavani
kaushikpavani / compute_caffe_parameters.py
Created September 25, 2016 14:14
Calculate number of parameters in a Caffe model
import caffe
caffe.set_mode_cpu()
import numpy as np
from numpy import prod, sum
from pprint import pprint
def print_net_parameters (deploy_file):
print "Net: " + deploy_file
net = caffe.Net(deploy_file, caffe.TEST)
print "Layer-wise parameters: "
anonymous
anonymous / predict.py
Created June 27, 2016 09:17
tenserflow seq2seq prediction
import numpy as np
import tensorflow as tf
from tensorflow.python.ops import seq2seq
from tensorflow.python.ops import rnn_cell
seed = 7
np.random.seed(7)
def generate_sequences(sequence_num, sequence_length, batch_size):
@kastnerkyle
kastnerkyle / pascalvoc.py
Last active June 4, 2018 21:41
Wrapper to read pascal voc data
# Author: Kyle Kastner # License: BSD 3-Clause # For a reference on parallel processing in Python see tutorial by David Beazley # http://www.slideshare.net/dabeaz/an-introduction-to-python-concurrency # Loosely based on IBM example # http://www.ibm.com/developerworks/aix/library/au-threadingpython/ # If you want to download all the PASCAL VOC data, use the following in bash... """ #! /bin/bash # 2008 wget http://host.robots.ox.ac.uk/pascal/VOC/voc2008/VOCtrainval_14-Jul-2008.tar # 2009 wget http://host.robots.ox.ac.uk/pascal/VOC/voc2009/VOCtrainval_11-May-2009.tar # 2010 wget http://host.robots.ox.ac.uk/pascal/VOC/voc2010/VOCtrainval_03-May-2010.tar # 2011 wget http://host.robots.ox.ac.uk/pascal/VOC/voc2011/VOCtrainval_25-May-2011.tar # 2012 wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar # Latest devkit wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCdevkit_18-May-2011.tar """ try: import Queue except ImportError: import queue as Queue import threading import ti
@d136o
d136o / README.md
Last active April 4, 2017 20:40
Getting familiar with TensorFlow

Computation Graph:

Instantiating Variable objects as well as Ops objects adds to a graph of computation that is tracked by tf.

After building your computation graph, where nodes are Variables or Ops or Constants, you can retrieve the executed and resulting value of any of the nodes in the graph.

The difference between Ops and Variables:

  • Ops take Tensor inputs and return Tensor outputs, they have no internal state.
@kaikuehne
kaikuehne / openface.md
Last active February 22, 2020 17:50
Installation and using openface to create and use your own classifier

Installation

Installation instructions are basically notes that I took while installing openface on MacOSX El Capitan.

System packages

brew install bash coreutils curl findutils opencv
brew install python --framework --universal --with-brewed-openssl
brew install boost-python --universal
@bsdnoobz
bsdnoobz / read-camera.py
Last active December 22, 2023 18:20
Displaying webcam feed using OpenCV and Python+PySide.
#!/usr/bin/env python
from PySide.QtCore import *
from PySide.QtGui import *
import cv2
import sys
class MainApp(QWidget):
def __init__(self):
@arvearve
arvearve / gist:4158578
Created November 28, 2012 02:01
Mathematics: What do grad students in math do all day?

Mathematics: What do grad students in math do all day?

by Yasha Berchenko-Kogan

A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.

The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.

What can you say?