code
stringlengths
3
6.57k
run_function ({})
initialization ({})
run_function ({})
initialization ({})
run_function ({})
initialization ({})
run_function ({})
terminate(self)
stop(self.pg)
w(j, p)
print([w(j, p)
import (RandomChoiceWithMask)
__all__.extend(_quant_ops.__all__)
__all__.sort()
print_c()
json.loads(a)
VersionInfo('mgen')
semantic_version()
_v.release_string()
_v.version_tuple()
point_distance(self,point)
sqrt(sum([ (a - b)
for (a,b)
zip(point,self.point)
separator_distance(self,point)
__repr__(self)
__init__(self, points, values=None)
kd_tree(points, values)
kd.nearest([2,0])
kd.nearest_n([2,0],2)
kd.in_sphere([0.1,0.2], 1.1)
len(p)
min(lengths)
max(lengths)
ValueError('points must all have the same dimension')
range(len(points)
len(points)
len(values)
ValueError('points and values must have the same lengths')
len(points)
self.__build(zip(points,values)
__build(self, pv_pairs, depth)
sorted(pv_pairs, key=lambda x: x[0][axis])
len(pv_pairs)
self.node()
self.__build(pv_pairs[:mid], depth+1)
self.__build(pv_pairs[mid+1:], depth+1)
nearest(self, point, max_dist=float('inf')
self.nearest_n(point,n=1,max_dist=max_dist)
len(x)
in_sphere(self, point, radius, max_points=None)
float('inf')
self.nearest_n(point, n=max_points, max_dist=radius)
nearest_n(self, point, n, max_dist=float('inf')
integer (Maximum)
self.__nearest_n(point, n, max_dist, self.root, heap)
heap.sort()
for (neg_dist,node)
reversed(heap)
__nearest_n(self,point,n,max_dist,current,heap)
current.point_distance(point)
current.separator_distance(point)
heappush(heap,(-pt_dist,current)
len(heap)
heappop(heap)
len(heap)
min(-heap[0][0],max_dist)
self.__nearest_n(point,n,max_dist,current.left_child,heap)
self.__nearest_n(point,n,max_dist,current.right_child,heap)
abs(sep_dist)
self.__nearest_n(point,n,max_dist,current.right_child,heap)
self.__nearest_n(point,n,max_dist,current.left_child,heap)
inorder(x)
inorder(x.left_child)
inorder(x.right_child)
Config()
__init__(self, load=True)
os.path.exists(self.dir_output)
os.makedirs(self.dir_output)
get_logger(self.path_log)
requested (default)
self.load()
load(self)
load_vocab(self.filename_words)
load_vocab(self.filename_relation)
len(self.vocab_words)
len(self.vocab_relations)
get_processing_word(self.vocab_words, UNK = "<UNK>")
get_processing_word(self.vocab_relations, UNK='NA')
np.load(self.filename_embeddings)
vocab (created from dataset with build_data.py)
test_rvec_to_quaterion()
np.array([math.pi/2.0, 0.0, 0.0])
reg._rvec_to_quaternion(rvec)
math.cos(math.pi/4.0)
math.sin(math.pi/4.0)
test_quaterion_to_matrix()
np.array([math.cos(math.pi/4.0)
math.sin(math.pi/4.0)
reg.quaternion_to_matrix(quaternion)