Skip to content

Instantly share code, notes, and snippets.

@nickyongzhang
nickyongzhang / Default.json
Created June 6, 2019 17:19
Code to reproduce the GPU OOM error
{
"batch_size": 128,
"kernel_size": 3,
"seq_length": 20,
"dropout": 0.2,
"emb_dropout": 0.25,
"clip": 0.4,
"softmax_nsampled": 100,
"embedding_size": 64,
"lr": 0.001,
@nickyongzhang
nickyongzhang / rank_metrics.py
Created April 16, 2019 17:51 — 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
@nickyongzhang
nickyongzhang / PageRank-UUI.ipynb
Last active March 18, 2019 09:24
This task aims at combining the PageRank model on UUI network with current FMT model to detect more fraud cases.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nickyongzhang
nickyongzhang / UUI_network_analysis+shareVoucher+yongzhang.ipynb
Last active February 17, 2019 14:45
Build network whose edges denoting users having the same pattern when using vouchers.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nickyongzhang
nickyongzhang / UUI_network_analysis+sharePayment+yongzhang.ipynb
Last active February 13, 2019 08:41
Build network whose edges denoting users sharing bank accounts or credit cards
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nickyongzhang
nickyongzhang / UUI_network_analysis+shareIP+yongzhang.ipynb
Last active February 18, 2019 03:06
Build network whose edges denoting users appearing in the same IP address
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nickyongzhang
nickyongzhang / pg-pong.py
Created March 20, 2017 12:49 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward