Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
# Check whether for each demo paper, the authors of that paper has a poster to be presented in the same session | |
import collections | |
import pandas as pd | |
import numpy as np | |
def main(): | |
posters_df = pd.read_csv('posters.csv') | |
demos_df = pd.read_csv('demos.csv') | |
posters_selected = posters_df[["Session", "Author"]] |
This file contains hidden or 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
property theURLPrefixes : {"https://www.aclweb.org/anthology/"} | |
property thePDFExtension : ".pdf" | |
on hasAnyPrefix(theString, thePrefixes) | |
repeat with thePrefix in thePrefixes | |
if theString starts with thePrefix then return true | |
end repeat | |
return false | |
end hasAnyPrefix |
This file contains hidden or 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 statsmodels.stats.proportion import proportion_confint as binofit | |
# download statmodels from: http://statsmodels.sourceforge.net/ | |
import sys | |
acc = float(sys.argv[1]) | |
# 0.01 confidence intervals | |
easy_interval = binofit(acc * 400, 400, 0.01) | |
print "0.01 interval = ", easy_interval | |
strict_interval = binofit(acc * 400, 400, 0.001) |
This file contains hidden or 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 math | |
import sys | |
r = float(sys.argv[1]) | |
num = int(sys.argv[2]) | |
stderr = 1.0 / math.sqrt(num - 3) | |
delta = 1.96 * stderr | |
lower = math.tanh(math.atanh(r) - delta) | |
upper = math.tanh(math.atanh(r) + delta) | |
print "lower %.6f upper %.6f" % (lower, upper) |
This file contains hidden or 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
""" | |
This code shows how to perform convolution between two vectors. | |
Danushka Bollegala. | |
14-04-2016 | |
""" | |
import numpy |
This file contains hidden or 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 | |
import matplotlib.pyplot as plt | |
import sys | |
def bval(D, r, s): | |
n = D.shape[0] | |
total_r = numpy.sum(D[:,s] ** 2) | |
total_s = numpy.sum(D[r,:] ** 2) | |
total = numpy.sum(D ** 2) |
This file contains hidden or 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
""" | |
This script demonstrates the optimization for a oblong quadratic function | |
using stochastic gradient descent (SGD), SGD with classical momentum (CM), | |
and SGD with Nestrov's accelerated gradient (NAG). | |
You will require matplotlib and numpy to run this example. | |
Danushka Bollegala. | |
20th June 2015. | |
""" |
This file contains hidden or 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
""" | |
This program compares ADAM vs AdaGrad. You can modify the function f and its gradient grad_f | |
in the code, run the two algorithms and compare their convergence. For the simple function | |
f(x1, x2) = (x1 - 2) ** 2 + (x1 + 3) ** 2, (alpha = 0.1 and tolerence 1e-3) | |
AdaGrad converged at 2023 iterations, whereas ADAM required only 83! | |
""" | |
import numpy |
This file contains hidden or 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 theano import Tensor as T | |
# If you want to multiply two matrices (matrix product) in theano do the following | |
T.dot(X,Y) | |
# This will multiply matrix X (n,m) into the matrix Y(m,k) and produce a matrix (n,k) | |
# You can use this to compute inner-product between two row vectors as well | |
T.dot(w,x) | |
# will give the inner-product wx\T where w(n,) and x(n,) |
NewerOlder