Skip to content

Instantly share code, notes, and snippets.

View np000's full-sized avatar
🏠
Working from home

nano np000

🏠
Working from home
View GitHub Profile
@np000
np000 / tf2.x_rnn.py
Last active March 27, 2020 08:44
tensorflow 2.x based rnn implementation
import tensorflow as tf
class Rnn(tf.Module):
def __init__(self, features, n_in=5, n_hid=5, init_state=None, n_out=None):
self._n_in = n_in
self._n_hid = n_hid
self._n_out = n_out
self._init_state = init_state
self._batch_size = 64
@np000
np000 / tf1.x_rnn.py
Last active March 23, 2020 04:31
tensorflow 2.x based rnn implementation
from __future__ import print_function
import tensorflow as tf
from tensorflow.contrib.layers import xavier_initializer
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class BasicRnn(object):