Skip to content

Instantly share code, notes, and snippets.

View alrojo's full-sized avatar

A Johansen alrojo

View GitHub Profile
@alrojo
alrojo / rnn_decoder_attention.md
Last active February 19, 2018 06:25
rnn_decoder_attention.md
from tensorflow.python.ops import tensor_array_ops
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import variable_scope as vs
from tensorflow.python.ops import rnn
from tensorflow.python.ops import nn
from tensorflow.python.ops import init_ops
@alrojo
alrojo / gist:d66240bdb8fdb2658081c3918ed8efb2
Last active December 20, 2016 17:13
attention_rnn_decoder
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib import layers
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import control_flow_ops
@alrojo
alrojo / dl.py
Created March 2, 2018 11:54
wmt 2014
# made by Alexander Rosenberg Johansen
# BSD-3 License
# Hardcoded for German, but should be easily extendable to all other wmt languages
# notice: you will need handle-sgm.py as well
from six.moves.urllib.request import urlretrieve
import json
import glob
import subprocess
import os
from tqdm import tqdm
# made by Alexander Rosenberg Johansen
# BSD-3 license
import glob
import subprocess
test_paths_2014 = [
'data/test-full/newstest2014-deen-src.en.sgm',
'data/test-full/newstest2014-deen-src.de.sgm']