Skip to content

Instantly share code, notes, and snippets.

View zhouxincheng's full-sized avatar
🎯
Focusing

whatever zhouxincheng

🎯
Focusing
View GitHub Profile
@zhouxincheng
zhouxincheng / mnist_tfdata.py
Created December 15, 2019 09:03 — forked from datlife/mnist_tfdata.py
Training Keras model with tf.data
"""An example of how to use tf.Dataset in Keras Model"""
import tensorflow as tf # only work from tensorflow==1.9.0-rc1 and after
_EPOCHS = 5
_NUM_CLASSES = 10
_BATCH_SIZE = 128
def training_pipeline():
# #############
# Load Dataset
@zhouxincheng
zhouxincheng / pagerank.py
Created November 21, 2019 10:00 — forked from diogojc/pagerank.py
python implementation of pagerank
import numpy as np
from scipy.sparse import csc_matrix
def pageRank(G, s = .85, maxerr = .001):
"""
Computes the pagerank for each of the n states.
Used in webpage ranking and text summarization using unweighted
or weighted transitions respectively.
@zhouxincheng
zhouxincheng / rank_metrics.py
Created October 8, 2019 08:25 — 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