Skip to content

Instantly share code, notes, and snippets.

View jihobak's full-sized avatar

piper jihobak

  • eigencapital
  • Daegu, South Korea
View GitHub Profile
@jihobak
jihobak / Test.py
Created July 6, 2017 12:59 — forked from tuxmartin/Test.py
Python ORM example (Python + SQLAlchemy + SQlite/MySQL)
from sqlalchemy.ext.declarative import declarative_base
#from sqlalchemy import *
#from sqlalchemy.orm import *
# Pro entity v podadresari. Podaresar *musi* obsahovat prazdny soubor __init__.py !
#from entity.User import User
'''
Zavislosti:
# apt-get install python-sqlalchemy
@jihobak
jihobak / module_param.md
Created June 18, 2017 09:32 — forked from kimhoki/module_param.md
[Device Driver] param , PARM, 커널 모듈 매개 변수 매크로

module_param_named, 커널 모듈 매개 변수 매크로

모듈 매개 변수 지정 방법:

#include:

#include <linux/moduleparam.h>
@jihobak
jihobak / bnlstm.py
Created March 4, 2017 11:45 — forked from spitis/bnlstm.py
Batch normalized LSTM Cell for Tensorflow
"""adapted from https://github.com/OlavHN/bnlstm to store separate population statistics per state"""
import tensorflow as tf, numpy as np
RNNCell = tf.nn.rnn_cell.RNNCell
class BNLSTMCell(RNNCell):
'''Batch normalized LSTM as described in arxiv.org/abs/1603.09025'''
def __init__(self, num_units, is_training_tensor, max_bn_steps, initial_scale=0.1, activation=tf.tanh, decay=0.95):
"""
* max bn steps is the maximum number of steps for which to store separate population stats
"""
@jihobak
jihobak / elastic_transform.py
Created February 28, 2017 10:12 — forked from ernestum/elastic_transform.py
Elastic transformation of an image in Python
import numpy as np
from scipy.ndimage.interpolation import map_coordinates
from scipy.ndimage.filters import gaussian_filter
def elastic_transform(image, alpha, sigma, random_state=None):
"""Elastic deformation of images as described in [Simard2003]_.
.. [Simard2003] Simard, Steinkraus and Platt, "Best Practices for
Convolutional Neural Networks applied to Visual Document Analysis", in
Proc. of the International Conference on Document Analysis and
Recognition, 2003.
@jihobak
jihobak / labels_1024.tsv
Created February 15, 2017 21:59 — forked from teamdandelion/labels_1024.tsv
TensorBoard: TF Dev Summit Tutorial
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
7
2
1
0
4
1
4
9
5
9
@jihobak
jihobak / cython_array_loop.ipynb
Created December 2, 2016 03:47 — forked from jskDr/cython_array_loop.ipynb
Cython can improve the speed with 1d numpy array in a IPython notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jihobak
jihobak / rest_api.py
Created July 7, 2016 01:06 — forked from mcchae/rest_api.py
Flask REST API sample
#!/usr/bin/env python
#coding=utf8
##########################################################################################
import os
import logging
import logging.handlers
import traceback
from flask import Flask
from flask.ext.restful import reqparse, abort, Api, Resource
from flask import request
@jihobak
jihobak / api_client.py
Created July 7, 2016 01:03 — forked from mcchae/api_client.py
Flask File Upload
##########################################################################################
import os
import sys
import json
import unittest
import pprint
import httplib
import urllib
import datetime
import random
@jihobak
jihobak / automation.md
Created June 24, 2016 06:56 — forked from cube-drone/automation.md
Automation For The People

Automation for the People

Long ago, the first time I read "The Pragmatic Programmer", I read some advice that really stuck with me.

"Don't Use Manual Procedures".

This in the chapter on Ubiquitous Automation. To summarize, they want you to automate all the things.

The trouble was that I hadn't much of an idea how to actually go

@jihobak
jihobak / cifar10_resnet.py
Created June 7, 2016 10:45 — forked from kashif/cifar10_resnet.py
Keras Pre-activation Residual Network for CIFAR-10
from __future__ import print_function
from keras.datasets import cifar10
from keras.layers import merge, Input
from keras.layers.convolutional import Convolution2D, ZeroPadding2D, AveragePooling2D
from keras.layers.core import Dense, Activation, Flatten
from keras.layers.normalization import BatchNormalization
from keras.models import Model
from keras.preprocessing.image import ImageDataGenerator
from keras.utils import np_utils