This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
def plot(n): | |
# x = np.random.rand(n) | |
x = np.random.normal(size=n)**2 | |
y = np.arange(0., 5., 0.01) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import numpy as np | |
predicates_in_batch = 2 | |
seq_len = 3 | |
vn_labels = 4 | |
d = 5 | |
np.random.seed(5) | |
tf.set_random_seed(5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import re | |
conll12_fname = "/home/strubell/research/data/conll-2012-new/conll2012-train.txt" | |
# conll12_fname = "/home/strubell/research/data/conll05st-release/train-set.gz.parse.sdeps.combined.bio" | |
semlink_fname = "/home/strubell/research/data/semlink-1.2.2c/semlink-wsj.txt" | |
remove_list = ['rel', 'LINK-SLC', 'LINK-PSV', 'LINK-PRO'] | |
arg_re = re.compile(r"(ARG[0-5A])-[A-Za-z]+") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
from __future__ import print_function | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import os | |
from matplotlib import rc | |
# rc('font',**{'family':'serif', 'serif':['Times']}) | |
# rc('text', usetex=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open(os.devnull, 'w') as devnull: | |
try: | |
srl_eval = check_output(["perl", "bin/srl-eval.pl", srl_gold_fname, srl_preds_fname], stderr=devnull) | |
print(srl_eval) | |
overall_f1 = float(srl_eval.split('\n')[6].split()[-1]) | |
correct['F1'] = overall_f1 | |
except CalledProcessError as e: | |
print("Call to eval failed: %s" % e.output) | |
with open(os.devnull, 'w') as devnull: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if self.conll: | |
vocab_files = [(self.word_file, 1, 'Words'), | |
(self.tag_file, [3, 4], 'Tags'), | |
(self.rel_file, 7, 'Rels')] | |
elif self.conll2012: | |
vocab_files = [(self.word_file, 3, 'Words'), | |
(self.tag_file, [5, 4], 'Tags'), # auto, gold | |
(self.rel_file, 7, 'Rels'), | |
(self.srl_file, range(14, 50), 'SRLs'), | |
(self.trig_file, [10, 4] if self.joint_pos_predicates else 10, 'Trigs'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import print_function | |
import numpy as np | |
import tensorflow as tf | |
def gather_scatter_example(): | |
batch_size = 2 | |
seq_len = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\begin{block}{Example action graph} | |
\begin{columns}[t,totalwidth=\textwidth] | |
\column{\textwidth} | |
% \vspace*{-0.7cm} | |
% \begin{block}{Experimental results} | |
\begin{columns}[t,totalwidth=\textwidth] | |
\column{.52\textwidth} | |
\vspace{-1.75cm} | |
\begin{tcolorbox}[colback=white,colframe=dblue!70,title=Typical synthesis procedure text,left skip=1cm] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
from __future__ import print_function | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import os | |
import string | |
import operator | |
def sorted_mean(l): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
from __future__ import print_function | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import os | |
import string | |
import operator | |
def sorted_mean(l): |
NewerOlder