Skip to content

Instantly share code, notes, and snippets.

View cedrickchee's full-sized avatar
⚒️
⚡ 🦀 🐿️ 🐘 🐳 ⬡ ⚛️ 🚢 🚀 🦄 🍵

Cedric Chee cedrickchee

⚒️
⚡ 🦀 🐿️ 🐘 🐳 ⬡ ⚛️ 🚢 🚀 🦄 🍵
View GitHub Profile
@cedrickchee
cedrickchee / amsgrad.py
Created April 14, 2018 03:52 — forked from kashif/amsgrad.py
Keras implementation of AMSGrad optimizer from "On the Convergence of Adam and Beyond" paper
class AMSgrad(Optimizer):
"""AMSGrad optimizer.
Default parameters follow those provided in the Adam paper.
# Arguments
lr: float >= 0. Learning rate.
beta_1: float, 0 < beta < 1. Generally close to 1.
beta_2: float, 0 < beta < 1. Generally close to 1.
epsilon: float >= 0. Fuzz factor.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cedrickchee
cedrickchee / amend-git-commit-author.sh
Created May 14, 2018 07:31
Amend last git commit author name and email and force push to git repo.
git commit --amend --author "John Doe <john.doe@gmail.com>" --no-edit
git rebase --continue
git push origin master --force
@cedrickchee
cedrickchee / nlp_genomics_ideas.md
Last active May 17, 2018 00:13
Some possible NLP applications in genomics

Originally forked from Philipp Bayer's gist. All credits goes to him.

This gist convert the original text to markdown for better readability.

Problems and Ideas:

1. Gene function prediction - given a predicted protein or gene sequence, what is the function?

The classic approach is to use something like BLAST to compare with known sequences, but this has many drawbacks. For starters, in plants the databases lean very heavily towards Arabidopsis thaliana, not more common plants such as maize or wheat.

@cedrickchee
cedrickchee / README-Template.md
Created May 24, 2018 07:10 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@cedrickchee
cedrickchee / create_kg_dog_breed_ident_sub.py
Created January 18, 2018 14:33
Create Kaggle Dog Breed Identification Challenge submission.csv file
# Step - Submit Predictions
# We have finished training and ready to run predictions on the test set.
log_test_preds = learn.predict(is_test=True)
# Convert log predictions to just probabilities (predictions).
test_preds = np.exp(log_test_preds)
# Create the submission file using the probabilities
# Get a list of image file names from the test data loader
im_fnames = data.test_dl.dataset.fnames
@cedrickchee
cedrickchee / README.md
Last active May 30, 2018 09:30 — forked from binga/pascal_pandas.ipynb
A quick way to get the bounding boxes in fastai CSV format ready for bounding box regression using Pandas.

This gist was being mentioned by Jeremy in fast.ai deep learning part 2 2018, lesson 9 video. In this lesson, we are learning multi-class object detection (computer vision) using the pascal-multi.ipynb notebook.

One of the fast.ai's students pointed out that by using Pandas, we can do things much simpler than using Python collections.defaultdict and shared this gist.

>The more you get to know Pandas, the more often you realize it is a good way to solve lots of different problems.

@cedrickchee
cedrickchee / quick_notes.md
Created June 11, 2018 15:32
"Building the Software 2.0 Stack" talk: https://vimeo.com/272696002

My Notes for the Talk

A talk by Andrej Karpathy at Train AI 2018 conference - machine learning for a human world.

Training Datasets

The part around building and managing datasets is very interesting. We don't get to hear about these problems often.

Software 2.0 Integrated Development Enviroments (IDEs)

What IDEs including code editors will look like?

@cedrickchee
cedrickchee / self_notes.md
Created June 18, 2018 19:45
Change habits

My notes on self-improvement plan.

Ways to change habits:

  1. Get more sleep
  2. Make time to exercise
  3. Drink more water
  4. Eat less sugar
  5. Stay teachable
  6. Read and write more
@cedrickchee
cedrickchee / nalu.py
Last active August 4, 2018 09:50
Keras implementation of DeepMind's Neural Arithmetic Logic Units (NALU). Paper: https://arxiv.org/abs/1808.00508
import numpy as np
import keras.backend as K
from keras.layers import *
from keras.models import *
import tensorflow as tf
class Nalu(Layer):
def __init__(self, units, krnl_init="glorot_uniform", **kwargs):
if "inp_shp" not in kwargs and "inp_dim" in kwargs: