Skip to content

Instantly share code, notes, and snippets.

View thiakx's full-sized avatar

Thia Kai Xin thiakx

View GitHub Profile
@thiakx
thiakx / Hex.geojson
Created April 8, 2014 06:27
hexagonal binning of Kaggle 311 predicition data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thiakx
thiakx / Hex.geojson
Created April 8, 2014 06:28
hexagonal binning of Kaggle 311 predicition data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"metadata": {
"name": "",
"signature": "sha256:461b10d5e75c36757ca3fd9450678c33ba1def215cc3977ee01b59a2c391d6b6"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
<!doctype HTML>
<html>
<head>
<link rel='stylesheet' href='//cdn.strategiqcommerce.com/ajax/libs/rickshaw/1.2.1/rickshaw.min.css'>
<link rel='stylesheet' href='//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css'>
<script src='//d3js.org/d3.v2.min.js' type='text/javascript'></script>
<script src='//cdn.strategiqcommerce.com/ajax/libs/rickshaw/1.2.1/rickshaw.min.js' type='text/javascript'></script>
<script src='//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js' type='text/javascript'></script>
<script src='//ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js' type='text/javascript'></script>
@thiakx
thiakx / tsne_tf_v2.ipynb
Created February 29, 2020 15:53
tsne_tf_v2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thiakx
thiakx / intro-to-visual-recsys.ipynb
Last active March 12, 2020 16:02
Intro to Visual RecSys.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thiakx
thiakx / modern-visual-recsys-part4b-covid-19-case-study-with-cnn.ipynb
Created March 21, 2020 09:24
Modern Visual RecSys Part4b: COVID-19 Case Study with CNN.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thiakx
thiakx / convolutional-neural-networks-recommender.ipynb
Last active March 31, 2020 01:43
Convolutional Neural Networks Recommender.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thiakx
thiakx / covid-19-case-study-with-cnn.ipynb
Last active March 31, 2020 01:43
COVID-19 Case Study with CNN.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def train_model(data, pretrained_model, model_metrics):
learner = cnn_learner(data, pretrained_model, metrics=model_metrics)
learner.model = torch.nn.DataParallel(learner.model)
learner.lr_find()
learner.recorder.plot(suggestion=True)
return learner
pretrained_model = models.resnet18
model_metrics = [accuracy, partial(top_k_accuracy, k=1), partial(top_k_accuracy, k=5)]
learner = train_model(data, pretrained_model, model_metrics)