Skip to content

Instantly share code, notes, and snippets.

View hanzlfs's full-sized avatar

Zhonglin Han hanzlfs

View GitHub Profile
@hanzlfs
hanzlfs / gist:9d52ef42c24ed437ff9eedf3748346a3
Created October 6, 2016 22:57 — forked from pawelmhm/gist:8917867
Scrapy spider crawling Stack Overflow
from scrapy.spider import Spider
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from scrapy.item import Item, Field
import urllib
class Question(Item):
tags = Field()
answers = Field()
@hanzlfs
hanzlfs / FMP.md
Created October 3, 2016 03:40 — forked from shagunsodhani/FMP.md
Notes on Fractional Max-Pooling

Fractional Max-Pooling (FMP)

Introduction

  • Link to Paper
  • Spatial pooling layers are building blocks for Convolutional Neural Networks (CNNs).
  • Input to pooling operation is a Nin x Nin matrix and output is a smaller matrix Nout x Nout.
  • Pooling operation divides Nin x Nin square into N2out pooling regions Pi, j.
  • Pi, j ⊂ {1, 2, . . . , Nin} ∀ (i, j) ∈ {1, . . . , Nout}2
pip install https://github.com/fchollet/keras/tarball/$version$
@hanzlfs
hanzlfs / dockerCheatSheet.md
Last active May 27, 2016 06:05
Docker Cheat Sheet
create bash
$ docker exec -i -t [Container Id or Name] bash
spark jobserver link
run with sudo
docker run -e GRANT_SUDO=yes -d -p 8888:8888 jupyter/all-spark-notebook start-notebook.sh 
@hanzlfs
hanzlfs / rank_metrics.py
Created December 10, 2015 22:13 — 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