Skip to content

Instantly share code, notes, and snippets.

View gentaiscool's full-sized avatar
:octocat:
Writing interesting code...

Genta Indra Winata gentaiscool

:octocat:
Writing interesting code...
View GitHub Profile
@gentaiscool
gentaiscool / AttentionWithContext.py
Created October 24, 2017 06:47 — forked from cbaziotis/AttentionWithContext.py
Keras Layer that implements an Attention mechanism, with a context/query vector, for temporal data. Supports Masking. Follows the work of Yang et al. [https://www.cs.cmu.edu/~diyiy/docs/naacl16.pdf] "Hierarchical Attention Networks for Document Classification"
def dot_product(x, kernel):
"""
Wrapper for dot product operation, in order to be compatible with both
Theano and Tensorflow
Args:
x (): input
kernel (): weights
Returns:
"""
if K.backend() == 'tensorflow':
@gentaiscool
gentaiscool / tensorflow.md
Last active November 7, 2019 08:22
Building Tensorflow on CentOS 7.X from Source

I figured out how to build tensorflow from source in centOS. This process does not require any root access and you can do it anywhere. This will save your time and no need to worry much after this.

#What to prepare:

  1. Java 8
  2. Bazel
  3. Tensorflow
  4. CuDNN and CUDA toolkit (assume you have install them)

#Installation ##Bazel