Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Keon keon

I may be slow to respond.
View GitHub Profile
chris-chris /
Last active Sep 11, 2017
simple 1-step gradient descent
# From udacity Machine Learning Nanodegree course
import numpy as np
# Define sigmoid function
def sigmoid(x):
return 1/(1+np.exp(-x))
# Derivative of the sigmoid function
def sigmoid_derivative(x):
cbaziotis /
Last active Apr 12, 2021
Keras Layer that implements an Attention mechanism for temporal data. Supports Masking. Follows the work of Raffel et al. []
from keras import backend as K, initializers, regularizers, constraints
from keras.engine.topology import Layer
def dot_product(x, kernel):
Wrapper for dot product operation, in order to be compatible with both
Theano and Tensorflow
j-min / RNN_hunkim's_tutorial_BasicRNNCell.ipynb
Last active Dec 11, 2018
TensorFlow 0.9 implementation of BasicRNNCell based on hunkim's tutorial
View RNN_hunkim's_tutorial_BasicRNNCell.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# coding: utf-8
# Imports
import os
import cPickle
import numpy as np
import theano
import theano.tensor as T

Used dueling network architecture with Q-learning, as outlined in this paper:

Dueling Network Architectures for Deep Reinforcement Learning
Ziyu Wang, Tom Schaul, Matteo Hessel, Hado van Hasselt, Marc Lanctot, Nando de Freitas

Command line:

python CartPole-v0 --gamma 0.995
Gyubin /
Last active Aug 29, 2015
자바스크립트로 동작하는 버튼이 있을 때 다음 페이지로 가는 방식을 구현한 scrapy spider, 네이버 지식쇼핑 다음페이지 숫자 링크 클릭할 때 동작하는 스크립트
from scrapy.spider import BaseSpider
from scrapy.http import Request, FormRequest
from scrapy.selector import HtmlXPathSelector
from scrapy.contrib.spiders import Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
class MySpider(BaseSpider):
name = "commu"
rrag / .block
Last active Aug 19, 2019
CandleStickChart with React StockCharts
View .block
license: MIT
height: 420
View react-app-file-structure
├── actions
├── stores
├── views
│   ├── Anonymous
│   │   ├── __tests__
│   │   ├── views
│   │   │   ├── Home
│   │   │   │   ├── __tests__
│   │   │   │   └── Handler.js
kachayev /
Last active Sep 7, 2020
Topological sort with Python (using DFS and gray/black colors)
# Simple:
# a --> b
# --> c --> d
# --> d
graph1 = {
"a": ["b", "c", "d"],
"b": [],
"c": ["d"],
"d": []

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

# remap prefix to Control + a