Skip to content

Instantly share code, notes, and snippets.

View ngovanmao's full-sized avatar

Ngo Van Mao ngovanmao

View GitHub Profile
@danijar
danijar / gru.py
Last active July 25, 2021 18:00
Gated Recurrent Unit with Layer norm and Xavier initializer
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
class GRU(tf.contrib.rnn.RNNCell):
@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.
@ptschandl
ptschandl / tensorboard_events_to_csv.py
Last active January 18, 2024 19:00
Extract all tensorboard events files to pandas dataframe
#!/usr/bin/env python3
'''
This script exctracts training variables from all logs from
tensorflow event files ("event*"), writes them to Pandas
and finally stores in long-format to a CSV-file including
all (readable) runs of the logging directory.
The magic "5" infers there are only the following v.tags:
[lr, loss, acc, val_loss, val_acc]