Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Keon keon

💭
I may be slow to respond.
View GitHub Profile
@chris-chris
chris-chris / simple_gradient_descent.py
Last active Sep 11, 2017
simple 1-step gradient descent
View simple_gradient_descent.py
# 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
cbaziotis / Attention.py
Last active Apr 12, 2021
Keras Layer that implements an Attention mechanism for temporal data. Supports Masking. Follows the work of Raffel et al. [https://arxiv.org/abs/1512.08756]
View Attention.py
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
Args:
@j-min
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.
View spynet.py
# coding: utf-8
# Imports
import os
import cPickle
import numpy as np
import theano
import theano.tensor as T
View README.md

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
http://arxiv.org/abs/1511.06581

Command line:

python duel.py CartPole-v0 --gamma 0.995
@Gyubin
Gyubin / commu.py
Last active Aug 29, 2015
자바스크립트로 동작하는 버튼이 있을 때 다음 페이지로 가는 방식을 구현한 scrapy spider, 네이버 지식쇼핑 다음페이지 숫자 링크 클릭할 때 동작하는 스크립트
View commu.py
#출처: https://ide.c9.io/redapple/so_18810850
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
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
kachayev / topological.py
Last active Sep 7, 2020
Topological sort with Python (using DFS and gray/black colors)
View topological.py
# Simple:
# a --> b
# --> c --> d
# --> d
graph1 = {
"a": ["b", "c", "d"],
"b": [],
"c": ["d"],
"d": []
}
View tmux.md

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