Skip to content

Instantly share code, notes, and snippets.

View chris-chris's full-sized avatar
🎯
Focusing

Chris Hoyean Song chris-chris

🎯
Focusing
View GitHub Profile
import tensorflow as tf
import numpy as np
from tensorflow.python.ops import variable_scope
from tensorflow.python.ops import init_ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import variables
from tensorflow.contrib.rnn.python.ops import rnn_cell
res = []
@chris-chris
chris-chris / cnn-in-numpy.py
Last active June 24, 2018 16:35
Convolution in numpy
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import dtypes
# 1. Setting up initial values
x = np.zeros((7, 7, 3))
x[:, :, 0] = np.mat(
"0 0 0 0 0 0 0;0 0 1 0 1 0 0;0 2 1 0 1 2 0;0 0 2 0 0 1 0;0 2 0 1 0 0 0;0 0 0 1 2 2 0;0 0 0 0 0 0 0"
).A
@chris-chris
chris-chris / lstm.py
Last active August 27, 2018 02:59 — forked from karpathy/gist:587454dc0146a6ae21fc
An efficient, batched LSTM.
"""
This is a batched LSTM forward and backward pass
"""
import numpy as np
import code
class LSTM:
@staticmethod
def init(input_size, hidden_size, fancy_forget_bias_init = 3):
@chris-chris
chris-chris / min-char-rnn.py
Last active August 30, 2018 09:59 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
Korean translation
최소 버전의 단어 레벨 바닐라 RNN 모델. Andrej Karpathy (@karpathy) 작성
- Korean comments
- Python3 compatibility update
"""
@chris-chris
chris-chris / sentry-centos-install.sh
Created October 27, 2018 08:11
One-shot dockerized sentry install
# 1. Install docker
# https://docs.docker.com/install/linux/docker-ce/centos/#install-docker-ce-1
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
@chris-chris
chris-chris / hashable_cache.py
Created July 22, 2019 06:59 — forked from adah1972/hashable_cache.py
Decorator for using dicts/lists with any Python cache function (like lru_cache)
# Inspired by https://gist.github.com/harel/9ced5ed51b97a084dec71b9595565a71
from collections import namedtuple
import functools
import json
import six
Serialized = namedtuple('Serialized', 'json')
@chris-chris
chris-chris / selenium-install
Created September 12, 2019 10:22 — forked from kaze/selenium-install
How to install Chrome, ChromeDriver and Selenium on CentOS. Plus a sample scraping script.
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@chris-chris
chris-chris / System Design.md
Created June 3, 2020 16:52 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@chris-chris
chris-chris / share_sns.html
Created August 15, 2020 08:23
SNS에 공유 버튼 만들기
<!-- SNS버튼 시작 -->
<div style="width: 100%; text-align: center; margin-bottom: 64px;">
<!-- 페이스북 공유 버튼 --> <a href="" onclick="window.open(url_combine_fb, '', 'scrollbars=no, width=600, height=600'); return false;"><img src="https://storage.googleapis.com/storage.chris-chris.ai/images/facebook.gif" title="페이스북으로 공유하기" class="sharebtn_custom" style="width: 32px;"></a>
<!-- 트위터 공유 버튼 --> <a href="" onclick="window.open(url_combine_tw, '', 'scrollbars=no, width=600, height=600'); return false;"><img src="https://storage.googleapis.com/storage.chris-chris.ai/images/twitter.gif" title="트위터로 공유하기" class="sharebtn_custom" style="width: 32px;"></a>
<!-- 카카오 스토리 공유 버튼 --> <a href="" onclick="window.open(url_combine_ks, '', 'scrollbars=no, width=600, height=600'); return false;"><img src="https://storage.googleapis.com/storage.chris-chris.ai/images/story.gif" title="카카오스토리로 공유하기" class="sharebtn_custom" style="width: 32px;"></a>
<!-- 네이버 공유 버튼 --> <a href="" onclick="window.open(url_combine_naver, '', 'scrol
@chris-chris
chris-chris / kpop_classifier_example.html
Last active August 26, 2020 02:59
연예인 분류기 결과물
<html>
<head>
<title>Teachable Machine Image Model with upload</title>
<!-- CSS only -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
</head>
<body style="text-align:center;">
<div>
<h3>