Skip to content

Instantly share code, notes, and snippets.

@kmjjacobs
kmjjacobs / gru_tensorflow.py
Last active August 14, 2022 17:10
GRU (Gated Recurrent Unit) implementation in TensorFlow and used in a simple Machine Learning task. The corresponding tutorial is found on Data Blogger: https://www.data-blogger.com/2017/08/27/gru-implementation-tensorflow/.
#%% (0) Important libraries
import tensorflow as tf
import numpy as np
from numpy import random
import matplotlib.pyplot as plt
from IPython import display
% matplotlib inline
#%% (1) Dataset creation.
@yoya
yoya / PIL_grayscale.py
Last active June 21, 2019 14:54
PIL Grayscale improve
# (c) [email protected] 2019/06/20-
# ref) https://pillow.readthedocs.io/en/stable/reference/Image.html
import sys
from PIL import Image
_rgb2xyz_rec709 = (
0.412453, 0.357580, 0.180423, 0,
0.212671, 0.715160, 0.072169, 0, # RGB mixing weight
0.019334, 0.119193, 0.950227, 0 )