query stringlengths 10 2k | document stringlengths 20 51.2k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Structured Dot is like dot, except that only the gradient wrt nonzero elements of the sparse matrix `a` are calculated and propagated. The output is presumed to be a dense matrix, and is represented by a TensorType instance. | def structured_dot(x, y):
# @todo: Maybe the triple-transposition formulation (when x is dense)
# is slow. See if there is a direct way to do this.
# (JB 20090528: Transposing tensors and sparse matrices is constant-time,
# inplace, and fast.)
if hasattr(x, 'getnnz'):
x = as_sparse... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dot_sparse(a, b):\n out = a @ b\n\n if isdense(out) and (isinstance(b, qarray) or isinstance(a, qarray)):\n out = qarray(out)\n\n return out",
"def dot(x,y,sparse=False):\n if sparse:\n res = tf.sparse_tensor_dense_matmul(x, y)\n else:\n res = tf.matmul(x, y)\n return r... | [
"0.6721932",
"0.63052",
"0.6295461",
"0.62358636",
"0.61262965",
"0.6076906",
"0.6057464",
"0.6052136",
"0.60111165",
"0.5956435",
"0.58913046",
"0.58731323",
"0.5839906",
"0.57086015",
"0.5653585",
"0.55790824",
"0.5574822",
"0.55547637",
"0.55450267",
"0.5531972",
"0.550827... | 0.6898988 | 0 |
Operation for efficiently calculating the dot product when one or all operands is sparse. Supported format are CSC and CSR. The output of the operation is dense. | def dot(x, y):
if hasattr(x, 'getnnz'):
x = as_sparse_variable(x)
if hasattr(y, 'getnnz'):
y = as_sparse_variable(y)
x_is_sparse_variable = _is_sparse_variable(x)
y_is_sparse_variable = _is_sparse_variable(y)
if not x_is_sparse_variable and not y_is_sparse_variable:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dot_sparse(a, b):\n out = a @ b\n\n if isdense(out) and (isinstance(b, qarray) or isinstance(a, qarray)):\n out = qarray(out)\n\n return out",
"def sparseVectorDotProduct(v1, v2):\n # BEGIN_YOUR_CODE (our solution is 4 lines of code, but don't worry if you deviate from this)\n return su... | [
"0.73774725",
"0.693938",
"0.69386786",
"0.69361544",
"0.68898225",
"0.686484",
"0.68250823",
"0.6751409",
"0.66028476",
"0.65272033",
"0.6478716",
"0.6265171",
"0.6250069",
"0.62209046",
"0.61603695",
"0.61342114",
"0.6113845",
"0.6113845",
"0.6113845",
"0.6113845",
"0.60987... | 0.69461495 | 1 |
Returns True iff x and y are equal (checks the dtype and shape if x and y are numpy.ndarray instances). | def check_equal_numpy(x, y):
if isinstance(x, numpy.ndarray) and isinstance(y, numpy.ndarray):
return (x.dtype == y.dtype and x.shape == y.shape and
numpy.any(abs(x - y) < 1e-10))
elif (isinstance(x, numpy.random.RandomState) and
isinstance(y, numpy.random.RandomState)):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __eq__(self, other):\n if self.get_dimensions() == other.get_dimensions():\n is_equal = (np.allclose(self.lon_arr, other.lon_arr) and\n np.allclose(self.lat_arr, other.lat_arr))\n else:\n is_equal = False\n return is_equal",
"def assert_result... | [
"0.7179889",
"0.71648973",
"0.7160076",
"0.70260113",
"0.70037794",
"0.6996649",
"0.6957536",
"0.6955224",
"0.6916414",
"0.6901935",
"0.6856239",
"0.68532807",
"0.68504894",
"0.6830843",
"0.6828493",
"0.67556214",
"0.6751637",
"0.671466",
"0.6705751",
"0.66998875",
"0.6697328... | 0.83483446 | 0 |
This function do the same as_tensor_variable, but don't transfert the value on the gpu | def as_cuda_or_tensor_variable(x, name=None, ndim=None):
if hasattr(x, '_as_CudaNdarrayVariable'):
# TODO: pass name and ndim arguments
return x._as_CudaNdarrayVariable()
return as_tensor_variable(x, name, ndim) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_variable(tensor, volatile=False):\n if torch.cuda.is_available():\n tensor = tensor.cuda()\n with torch.no_grad():\n return Variable(tensor)",
"def variables_on_gpu0():\n old_fn = tf.get_variable\n\n def new_fn(*args, **kwargs):\n with tf.device('/gpu:0'):\n return old_fn(*... | [
"0.6956316",
"0.6748812",
"0.6715655",
"0.6669878",
"0.65062237",
"0.63253886",
"0.61816823",
"0.61328584",
"0.61141104",
"0.61083996",
"0.60989594",
"0.609284",
"0.6076981",
"0.607409",
"0.6068334",
"0.6068334",
"0.6065408",
"0.60516536",
"0.59953344",
"0.5992732",
"0.596967... | 0.5914877 | 22 |
Return a symbolic `Constant` with value `x` | def constant_or_value(x, rtype, name=None, ndim=None, dtype=None):
if dtype is not None:
# in this case, the semantics are that the caller is forcing the dtype
x_ = theano._asarray(x, dtype=dtype)
else:
# In this case, this function should infer the dtype according to the
#... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _static_value(x):\n return tensor_util.constant_value(ops.convert_to_tensor(x))",
"def constant_equation(funct):\n return funct + \"x\"",
"def consider_constant(x):\r\n return consider_constant_(x)",
"def _call(self, x):\n return self.constant",
"def wrap_if_constant(x):\n\n if is_python... | [
"0.68164116",
"0.6428837",
"0.6370846",
"0.63040435",
"0.6183196",
"0.60870475",
"0.60397977",
"0.60269016",
"0.59481066",
"0.59250283",
"0.59226197",
"0.5875921",
"0.58123934",
"0.57945305",
"0.5722294",
"0.5680772",
"0.56560224",
"0.56074333",
"0.55792737",
"0.55425674",
"0... | 0.5776284 | 14 |
return the constant scalar(0D) value underlying variable `v` If v is the output of dimshuffles, fills, allocs, rebroadcasts, cast this function digs through them. If `v` is not some view of constant scalar data, then raise a NotScalarConstantError. | def get_scalar_constant_value(orig_v, elemwise=True):
v = orig_v
while True:
if v is None:
# None is not a scalar (and many uses of this function seem to depend
# on passing it None)
raise NotScalarConstantError()
if isinstance(v, (numpy.integer, int,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_constant(v):\r\n if isinstance(v, Variable):\r\n try:\r\n return get_scalar_constant_value(v)\r\n except NotScalarConstantError:\r\n return None\r\n else:\r\n return v",
"def to_scalar(self, v):\n raise NotImplementedErro... | [
"0.7703598",
"0.69126886",
"0.6854754",
"0.68517977",
"0.6536923",
"0.65216607",
"0.60794693",
"0.5967195",
"0.59613585",
"0.59493375",
"0.59013027",
"0.58791083",
"0.58538216",
"0.5841592",
"0.58376265",
"0.58003014",
"0.575258",
"0.5748521",
"0.5678576",
"0.5629559",
"0.560... | 0.7704809 | 0 |
Replace a symbol definition with an elementwise version of the corresponding scalar Op. If it is not None, the nfunc argument should be a string such that getattr(numpy, nfunc) implements a vectorized version of the elemwise operation. nin is the number of inputs expected by that function, and nout is the number of des... | def _scal_elemwise_with_nfunc(nfunc, nin, nout):
def construct(symbol):
symbolname = symbol.__name__
inplace = symbolname.endswith('_inplace')
if inplace:
msg = "inplace"
else:
msg = "no_inplace"
n = "Elemwise{%s,%s}" % (symbolname, msg)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scalar_op_helper(node, op_name, **kwargs):\n name, input_nodes, attrs = get_inputs(node, kwargs)\n from onnx import numpy_helper\n input_type = kwargs[\"in_type\"]\n scalar_value = np.array([attrs.get(\"scalar\", 1)],\n dtype=onnx.mapping.TENSOR_TYPE_TO_NP_TYPE[input_type... | [
"0.5737069",
"0.56801385",
"0.5456086",
"0.5433968",
"0.5433968",
"0.5361581",
"0.52362716",
"0.5174792",
"0.5149975",
"0.51341224",
"0.5099252",
"0.50983155",
"0.50413483",
"0.5012007",
"0.4999167",
"0.49711812",
"0.49687776",
"0.4934579",
"0.49073982",
"0.49068168",
"0.4880... | 0.70741266 | 0 |
Return the shape tuple of a TensorType Variable. It may be either symbolic or nonsymbolic. If the shape of the expression is not known at graphconstruction time, then a symbolic lvector will be returned, corresponding to the actual shape at graphexecution time. | def old_shape(a):
va = as_tensor_variable(a)
# print 'HERE', va, va.type
if None in va.type.shape:
# Some shape components are unknown at this time
return _shape(va)
else:
# all shape components are known at compile time, so we return
# a tuple directly. This tup... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_shape(tensor):\n\n if tensor.shape.dims is None:\n raise ValueError(\"Unknown rank for tensor {}.\".format(tensor))\n\n static_shape = tensor.shape.as_list()\n dynamic_shape = tf.shape(tensor)\n return tuple(elt if elt is not None else dynamic_shape[idx]\n for idx, elt in enumerate(sta... | [
"0.68979865",
"0.6470968",
"0.6337378",
"0.6315864",
"0.62630343",
"0.6218803",
"0.62147635",
"0.61991954",
"0.61991954",
"0.6186821",
"0.6108013",
"0.61020124",
"0.60236996",
"0.60027707",
"0.597731",
"0.59757215",
"0.59755164",
"0.59412855",
"0.59354615",
"0.59337354",
"0.5... | 0.72798055 | 0 |
Returns maximum elements and their indices obtained by iterating over given axis When axis is None (the default value), the max is performed over the flattened tensor. | def max_and_argmax(a, axis=None, keepdims=False):
out, argout = _max_and_argmax(a, axis)
if keepdims:
out = makeKeepDims(a, out, axis)
argout = makeKeepDims(a, argout, axis)
return [out, argout] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max(tensor, axis=None):\n raise NotImplementedError",
"def argmax(self, axis=None):\n return np.argmax(self.data, axis=axis)",
"def np_max(arr, axis):\n assert arr.ndim == 2\n assert axis in [0, 1]\n if axis == 0:\n result = np.empty(arr.shape[1])\n for i in range(len(r... | [
"0.724824",
"0.6530266",
"0.64368093",
"0.6202005",
"0.60933834",
"0.6069759",
"0.60609436",
"0.5995387",
"0.5893876",
"0.5829758",
"0.5819668",
"0.58098805",
"0.5755144",
"0.57506686",
"0.57250714",
"0.5722996",
"0.5712356",
"0.5712356",
"0.56515133",
"0.5636937",
"0.5574124... | 0.6145977 | 4 |
Returns maximum elements obtained by iterating over given axis When axis is None (the default value), the max is performed over the flattened tensor. | def max(x, axis=None, keepdims=False):
# We have a choice of implementing this call with the
# CAReduce op or the MaxAndArgmax op.
# MaxAndArgmax supports grad and Rop, so we prefer to use that.
# CAReduce is faster, but optimizations will replace MaxAndArgmax[0]
# with CAReduce at compile ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max(tensor, axis=None):\n raise NotImplementedError",
"def argmax(self, axis=None):\n return np.argmax(self.data, axis=axis)",
"def max(self, axis=None, keepdims=False, out=None):\n return np.maximum.reduce(self, out=out, axis=axis, keepdims=keepdims)",
"def np_max(arr, axis):\n a... | [
"0.7775883",
"0.696585",
"0.69341844",
"0.6737109",
"0.6614105",
"0.65722775",
"0.6506245",
"0.6401813",
"0.63378084",
"0.6292335",
"0.6292335",
"0.6165877",
"0.6124481",
"0.6117335",
"0.60704625",
"0.60572875",
"0.60204136",
"0.59997004",
"0.59997004",
"0.59918565",
"0.59614... | 0.6803677 | 3 |
Returns indices of maximum elements obtained by iterating over given axis When axis is None (the default value), the argmax is performed over the flattened tensor. | def argmax(x, axis=None, keepdims=False):
# In python (using MaxAndArgmax.perform()) this leads to a wasteful
# implementation that goes through the data twice instead of once
# but when Argmax.c_impl() is in place, it should be fine.
argout = max_and_argmax(x, axis)[1]
if keepdims:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def max(tensor, axis=None):\n raise NotImplementedError",
"def argmax(self, axis=None):\n return np.argmax(self.data, axis=axis)",
"def np_max(arr, axis):\n assert arr.ndim == 2\n assert axis in [0, 1]\n if axis == 0:\n result = np.empty(arr.shape[1])\n for i in range(len(r... | [
"0.69409966",
"0.6831495",
"0.6569564",
"0.64825016",
"0.63182765",
"0.6248863",
"0.6229924",
"0.6066773",
"0.60566384",
"0.5984634",
"0.59777457",
"0.59474856",
"0.5933257",
"0.58828855",
"0.58586097",
"0.5767985",
"0.5742343",
"0.5717005",
"0.57154953",
"0.5667022",
"0.5665... | 0.64336056 | 4 |
Returns minimum elements obtained by iterating over given axis When axis is None (the default value), the min is performed over the flattened tensor. | def min(x, axis=None, keepdims=False):
x = as_tensor_variable(x)
str_x_type = str(x.dtype)
if str_x_type.startswith('float') or str_x_type in int_dtypes:
return -max(-x, axis=axis, keepdims=keepdims)
else:
# Be careful about unsigned integers, complex
raise NotImplementedE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min(tensor, axis=None):\n raise NotImplementedError",
"def min(self, axis=None, keepdims=False, out=None):\n return np.minimum.reduce(self, out=out, axis=axis, keepdims=keepdims)",
"def min(self, axis=0, **kwargs) -> \"Dataset\":\n return self.aggregate(axis=axis, func=np.min, **kwargs... | [
"0.7784866",
"0.7037426",
"0.696356",
"0.6610114",
"0.6526864",
"0.64740574",
"0.6429388",
"0.6405041",
"0.6313597",
"0.6286133",
"0.6243407",
"0.613033",
"0.6057308",
"0.5968008",
"0.59335375",
"0.5897602",
"0.58619946",
"0.57644606",
"0.57644606",
"0.5732167",
"0.5714974",
... | 0.64099056 | 7 |
Returns indices of minimum elements obtained by iterating over given axis When axis is None (the default value), the argmin is performed over the flattened tensor. | def argmin(x, axis=None, keepdims=False):
x = as_tensor_variable(x)
str_x_type = str(x.dtype)
if str_x_type.startswith('float') or str_x_type in int_dtypes:
return argmax(-x, axis=axis, keepdims=keepdims)
else:
# Be careful about unsigned integers, complex
raise NotImpleme... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def min(tensor, axis=None):\n raise NotImplementedError",
"def argminima(arr, num, axis=None, ordered=True):\n if axis is not None:\n # TODO: implement this directly for argminima\n # if 0:\n # return argmaxima(-arr, num=num, axis=axis, ordered=ordered)\n # # raise NotIm... | [
"0.6992789",
"0.64138883",
"0.63589084",
"0.61628205",
"0.61308074",
"0.6126046",
"0.600418",
"0.59370905",
"0.59028167",
"0.5741264",
"0.5711783",
"0.5707543",
"0.56634647",
"0.56611466",
"0.56546235",
"0.56301165",
"0.55671144",
"0.5552719",
"0.5493812",
"0.54752225",
"0.53... | 0.63601327 | 2 |
Create a Tensor filled with zeros, closer to Numpy's syntax than ``alloc``. | def zeros(shape, dtype=None):
if not isinstance(shape, (list, tuple, TensorVariable)):
shape = [shape]
if dtype is None:
dtype = config.floatX
return alloc(numpy.array(0, dtype=dtype), *shape) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zeros(*shape, **kwargs):\n return Tensor(np.zeros(shape), **kwargs)",
"def zeros(shape, dtype=np.float32, constant=False):\n return Tensor(np.zeros(shape, dtype), constant=constant)",
"def empty(*shape, **kwargs):\n return Tensor(np.empty(shape), **kwargs)",
"def zeros_like(other, dtype=... | [
"0.8114555",
"0.7932596",
"0.7241787",
"0.7224017",
"0.7205505",
"0.71874917",
"0.71851045",
"0.71362686",
"0.6958642",
"0.6921242",
"0.68805903",
"0.6854649",
"0.6854649",
"0.67893547",
"0.67681295",
"0.6750072",
"0.6746667",
"0.6715195",
"0.6715099",
"0.67050195",
"0.669656... | 0.7627528 | 2 |
Create a Tensor filled with ones, closer to Numpy's syntax than ``alloc``. | def ones(shape, dtype=None):
if not isinstance(shape, (list, tuple, TensorVariable)):
shape = [shape]
if dtype is None:
dtype = config.floatX
return alloc(numpy.array(1, dtype=dtype), *shape) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ones(shape, **kwargs):\n return Tensor(np.ones(shape), **kwargs)",
"def ones(shape, dtype=np.float32, constant=False):\n return Tensor(np.ones(shape, dtype), constant=constant)",
"def empty(shape, dtype=np.float32, constant=False):\n return Tensor(np.empty(shape, dtype), constant=constant)",
... | [
"0.71366364",
"0.7083123",
"0.67079467",
"0.6693651",
"0.66849464",
"0.66567564",
"0.6495365",
"0.6473192",
"0.64660627",
"0.6412429",
"0.63924265",
"0.6340673",
"0.62876797",
"0.62673795",
"0.6235709",
"0.62353176",
"0.609355",
"0.6088435",
"0.60047907",
"0.60005265",
"0.598... | 0.6954518 | 2 |
Return a vector of indices that are nonzero in the flattened version of a. This is equivalent to nonzero(a.flatten(), return_matrix=True)[0] | def flatnonzero(a):
if a.ndim == 0:
raise ValueError('Nonzero only supports non-scalar arrays.')
return nonzero(a.flatten(), return_matrix=True)[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nonzero_values(a):\r\n return a.flatten()[flatnonzero(a)]",
"def nonzero_indices(a):\n return (np.nonzero(a)[0])",
"def to_sparse(a):\n flat = a.flatten()\n indices = np.nonzero(flat)\n values = flat[indices]\n return indices[0], values",
"def find(a):\n\n a = coo_matrix(a, copy=True... | [
"0.79677486",
"0.7472783",
"0.65534306",
"0.619018",
"0.58536905",
"0.58235556",
"0.58161753",
"0.5742437",
"0.5740348",
"0.568473",
"0.54798293",
"0.5374776",
"0.536096",
"0.5357475",
"0.5355382",
"0.5345242",
"0.52927685",
"0.5275793",
"0.52584064",
"0.5214561",
"0.5214089"... | 0.82989824 | 0 |
Return a vector of nonzero elements contained in the input array. The following behavior works to extract nonzero elements from an array | def nonzero_values(a):
return a.flatten()[flatnonzero(a)] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filter_zeros(X):\n\tnoNonzeros = np.count_nonzero(X, axis=1)\n\tmask = np.where(noNonzeros > 0)\n\treturn X[mask[0], :]",
"def nonzero_indices(a):\n return (np.nonzero(a)[0])",
"def nonzero(x, /):\n\n if isinstance(x, dpnp_array) or isinstance(x, dpt.usm_ndarray):\n dpt_array = x.get_array() i... | [
"0.74439013",
"0.726069",
"0.7071921",
"0.6948147",
"0.6924816",
"0.6802714",
"0.66787744",
"0.6645046",
"0.6601842",
"0.65615",
"0.6545373",
"0.6493197",
"0.6434492",
"0.6384936",
"0.63591987",
"0.6352518",
"0.6348085",
"0.6335746",
"0.6279848",
"0.6163878",
"0.61164993",
... | 0.77307385 | 0 |
An array with ones at and below the given diagonal and zeros elsewhere. | def tri(N, M=None, k=0, dtype=None):
if dtype is None:
dtype = config.floatX
if M is None:
M = N
op = Tri(dtype)
return op(N, M, k) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_diagonal_image(n):\n alist = []\n for i in range(0, n):\n alist.append([])\n for j in range(0,n):\n if i ==j:\n alist[i].append(1)\n else:\n alist[i].append(0)\n\n ##########\n # img = create_zeroed_image(n)\n # for i in rang... | [
"0.6350497",
"0.6188139",
"0.61799604",
"0.61567396",
"0.60967433",
"0.60499805",
"0.6025345",
"0.5965569",
"0.59413254",
"0.5923839",
"0.5901049",
"0.5879333",
"0.58767974",
"0.5842413",
"0.5827011",
"0.5818699",
"0.58063996",
"0.580456",
"0.58024645",
"0.57905376",
"0.57881... | 0.0 | -1 |
Lower triangle of an array. Return a copy of an array with elements above the `k`th diagonal zeroed. | def tril(m, k=0):
return m * tri(m.shape[0], m.shape[1], k=k, dtype=m.dtype) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _flatten_lower_triangle(matrix):\r\n matrix = asarray(matrix)\r\n flattened = []\r\n for col_num in range(matrix.shape[1]):\r\n for row_num in range(matrix.shape[0]):\r\n if col_num < row_num:\r\n flattened.append(matrix[row_num][col_num])\r\n return flattened",... | [
"0.6424659",
"0.59426177",
"0.57014954",
"0.5692015",
"0.5640066",
"0.5591971",
"0.55644524",
"0.555711",
"0.5503457",
"0.5499676",
"0.5477072",
"0.5471694",
"0.5448507",
"0.54372746",
"0.5417216",
"0.5393211",
"0.53762",
"0.5292432",
"0.52917886",
"0.52909225",
"0.52775836",... | 0.5678379 | 4 |
Upper triangle of an array. Return a copy of a matrix with the elements below the `k`th diagonal zeroed. Please refer to the documentation for `tril` for further details. See Also | def triu(m, k=0):
return m * (1 - tri(m.shape[0], m.shape[1], k=k - 1, dtype=m.dtype)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def triu(m, k=0):\r\n m = asanyarray(m)\r\n out = multiply((1-tri(m.shape[0], m.shape[1], k-1, int)),m)\r\n return out",
"def upper(mat):\n idx = np.triu_indices_from(mat, k=1)\n return mat[idx]",
"def tril(m, k=0):\r\n m = asanyarray(m)\r\n out = multiply(tri(m.shape[0], m.shape[1], k=k, ... | [
"0.6801571",
"0.6687167",
"0.6637209",
"0.6620465",
"0.64400077",
"0.63204116",
"0.5650078",
"0.5590787",
"0.5556354",
"0.5553688",
"0.5521871",
"0.5490091",
"0.5485894",
"0.548579",
"0.5459953",
"0.5439582",
"0.5404458",
"0.5388605",
"0.5333336",
"0.5298709",
"0.52246445",
... | 0.663607 | 3 |
Computes the sum along the given axis(es) of a tensor `input` When axis is None (the default value), the sum is performed over the flattened tensor. | def sum(input, axis=None, dtype=None, keepdims=False, acc_dtype=None):
out = elemwise.Sum(axis=axis, dtype=dtype, acc_dtype=acc_dtype)(input)
if keepdims:
out = makeKeepDims(input, out, axis)
return out | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sum(tensor, axis=None):\n raise NotImplementedError",
"def reduce_sum(\n input_tensor: remote_blob_util.BlobDef,\n axis: Optional[Union[int, Sequence[int]]] = None,\n keepdims: bool = False,\n name: Optional[str] = None,\n) -> remote_blob_util.BlobDef:\n name = _gen_unique_name_if_need(... | [
"0.7793166",
"0.73418295",
"0.7004505",
"0.6875938",
"0.67541414",
"0.6619207",
"0.65910935",
"0.6502543",
"0.6382531",
"0.63798743",
"0.63051075",
"0.62983966",
"0.62982386",
"0.6296958",
"0.6161169",
"0.615429",
"0.6147569",
"0.60211015",
"0.5973238",
"0.59724504",
"0.59644... | 0.76567787 | 1 |
Computes the product along the given axis(es) of a tensor `input` When axis is None (the default value), the product is performed over the flattened tensor. | def prod(input, axis=None, dtype=None, keepdims=False, acc_dtype=None,
no_zeros_in_input=False):
out = elemwise.Prod(axis, dtype=dtype, acc_dtype=acc_dtype,
no_zeros_in_input=no_zeros_in_input)(input)
if keepdims:
out = makeKeepDims(input, out, axis)
return... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prod(tensor, axis=None):\n raise NotImplementedError",
"def prod(self, axis=None, keepdims=False, dtype=None, out=None):\n return np.multiply.reduce(\n self, out=out, axis=axis, keepdims=keepdims, dtype=dtype\n )",
"def cumprod(a, axis=None, dtype=None, out=None):\n a = a... | [
"0.7694031",
"0.70047736",
"0.6523551",
"0.6224089",
"0.6208941",
"0.6188622",
"0.6152616",
"0.61516815",
"0.61516815",
"0.61516815",
"0.61516815",
"0.6119046",
"0.6112944",
"0.60172",
"0.5951879",
"0.58886904",
"0.5762733",
"0.5752329",
"0.569997",
"0.567984",
"0.5668961",
... | 0.7686269 | 1 |
The gradient wrt a join op is a `Split`, used to partition the gradient along the `axis` which was used for joining. | def grad(self, axis_and_tensors, grads):
gz, = grads
axis, tensors = axis_and_tensors[0], axis_and_tensors[1:]
rval = [grad_undefined(self, 0, axis)]
if 'float' in tensors[0].dtype or 'complex' in tensors[0].dtype:
# assume that this is differentiable
sp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def local_gpu_join(node):\r\n if isinstance(node.op, tensor.Join):\r\n # optimizing this case:\r\n # join(host_from_gpu) -> host_from_gpu(gpu_join)\r\n\r\n # print \"OPT: we've got a Join instance\"\r\n\r\n axis_and_tensors = node.inputs\r\n\r\n #print \"OPT: axis_and_tensors=... | [
"0.57664996",
"0.5626092",
"0.54975873",
"0.54575694",
"0.541662",
"0.5383518",
"0.5262162",
"0.5229261",
"0.52108085",
"0.51761836",
"0.51553106",
"0.5143633",
"0.51202816",
"0.5115139",
"0.51109976",
"0.5094788",
"0.5076244",
"0.5068464",
"0.504435",
"0.50391924",
"0.502251... | 0.47813413 | 64 |
Reshape `t` by leftpadding the shape with `n_ones` 1s | def shape_padleft(t, n_ones=1):
_t = as_tensor_variable(t)
pattern = ['x'] * n_ones + [i for i in xrange(_t.type.ndim)]
return DimShuffle(_t.broadcastable, pattern)(_t) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shape_padright(t, n_ones=1):\r\n _t = as_tensor_variable(t)\r\n\r\n pattern = [i for i in xrange(_t.type.ndim)] + ['x'] * n_ones\r\n return DimShuffle(_t.broadcastable, pattern)(_t)",
"def _flatten(self, inputT, size):\n return tf.reshape(inputT, (-1, size))",
"def reshape_0(tensor):\n row =... | [
"0.7062817",
"0.61669916",
"0.58922756",
"0.5669961",
"0.560652",
"0.5505216",
"0.5504581",
"0.549013",
"0.5471143",
"0.5449762",
"0.5433251",
"0.54205585",
"0.53941214",
"0.5382836",
"0.53749126",
"0.5363019",
"0.53562427",
"0.53562427",
"0.5333534",
"0.53334403",
"0.5331707... | 0.7201676 | 0 |
Reshape `t` by rightpadding the shape with `n_ones` 1s | def shape_padright(t, n_ones=1):
_t = as_tensor_variable(t)
pattern = [i for i in xrange(_t.type.ndim)] + ['x'] * n_ones
return DimShuffle(_t.broadcastable, pattern)(_t) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shape_padleft(t, n_ones=1):\r\n _t = as_tensor_variable(t)\r\n\r\n pattern = ['x'] * n_ones + [i for i in xrange(_t.type.ndim)]\r\n return DimShuffle(_t.broadcastable, pattern)(_t)",
"def pad_single_tensor(tensor):\n rank = len(tensor.shape)\n assert rank > 0\n padding = array_ops.sta... | [
"0.76907456",
"0.59521455",
"0.589619",
"0.5883953",
"0.57347214",
"0.56720024",
"0.5669585",
"0.5649204",
"0.5635579",
"0.5629173",
"0.561693",
"0.54293257",
"0.54060775",
"0.5405035",
"0.53608453",
"0.53193045",
"0.5295371",
"0.5287518",
"0.52765733",
"0.52758026",
"0.52490... | 0.81224394 | 0 |
Tile input array `x` according to `reps`. See the docstring of `numpy.tile` for details. Currently, `reps` must be a constant, x.ndim and len(reps) must be equal and, if specified, 'ndim' must be equal to both. | def tile(x, reps, ndim=None):
try:
assert python_all([int(i) == i for i in iter(reps)])
except (TypeError, AssertionError):
raise ValueError("reps argument to tile must be a constant (e.g. "
"tuple, list of integers)")
if len(reps) != x.ndim:
raise ValueError("len(re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tile(A, reps):\n from ..merge import concatenate\n\n try:\n tup = tuple(reps)\n except TypeError:\n tup = (reps,)\n\n d = len(tup)\n if A.ndim < d:\n A = A[tuple(np.newaxis for _ in range(d - A.ndim))]\n elif A.ndim > d:\n tup = (1,) * (A.ndim - d) + tup\n\n a =... | [
"0.74933225",
"0.6412856",
"0.6319121",
"0.62875223",
"0.62787706",
"0.627069",
"0.6228165",
"0.6136349",
"0.6135464",
"0.6051095",
"0.6002456",
"0.58687913",
"0.5827486",
"0.5827486",
"0.5715209",
"0.56526977",
"0.5558318",
"0.54628557",
"0.53579646",
"0.5213467",
"0.5130406... | 0.82192004 | 0 |
Computes the dot product of two variables. For two matrices, this is equivalent to matrix multiplication. For two vectors, this is the inner product. When one variable is a scalar, this is like elementwise multiplication. For N dimensions, this is a sum product over the last axis | def dot(a, b):
a, b = as_tensor_variable(a), as_tensor_variable(b)
if a.ndim == 0 or b.ndim == 0:
return a * b
elif a.ndim > 2 or b.ndim > 2:
return tensordot(a, b, [[a.ndim - 1], [numpy.maximum(0, b.ndim - 2)]])
else:
return _dot(a, b) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dotProduct(v1, v2):\n return sum((a * b) for a, b in zip(v1, v2))",
"def dotproduct(vec1, vec2):\n return sum((a*b) for a, b in zip(vec1, vec2))",
"def dot_product(v1, v2):\n return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2]",
"def dotProduct(v1, v2):\n n1 = normalize(v1)\n n2 = normalize(v2)... | [
"0.83694947",
"0.82213724",
"0.8207995",
"0.8166998",
"0.8149642",
"0.8145419",
"0.8129654",
"0.8055662",
"0.8027351",
"0.80066824",
"0.80010873",
"0.7987732",
"0.7973771",
"0.79224646",
"0.791723",
"0.7909366",
"0.78777194",
"0.78667367",
"0.7812349",
"0.78072745",
"0.779439... | 0.83406395 | 1 |
Given two tensors a and b,tensordot computes a generalized dot product over the provided axes. Theano's implementation reduces all expressions to matrix or vector dot products and is based on code from Tijmen Tieleman's | def tensordot(a, b, axes=2):
a, b = as_tensor_variable(a), as_tensor_variable(b)
# axes must be a scalar or list/tuple of length 2
if not numpy.isscalar(axes) and len(axes) != 2:
raise ValueError('Axes should be an integer or a '
'list/tuple of len 2 (%s was provided)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dot(a, b):\r\n a, b = as_tensor_variable(a), as_tensor_variable(b)\r\n\r\n if a.ndim == 0 or b.ndim == 0:\r\n return a * b\r\n elif a.ndim > 2 or b.ndim > 2:\r\n return tensordot(a, b, [[a.ndim - 1], [numpy.maximum(0, b.ndim - 2)]])\r\n else:\r\n return _dot(a, b)",
"def tens... | [
"0.8177067",
"0.7927701",
"0.7919285",
"0.75524235",
"0.751558",
"0.7448788",
"0.723901",
"0.7223381",
"0.71536565",
"0.71158653",
"0.7072845",
"0.69858205",
"0.69513184",
"0.6887674",
"0.6885447",
"0.6870403",
"0.68336874",
"0.6819857",
"0.6817149",
"0.67972195",
"0.6766569"... | 0.8243841 | 0 |
Return vectorvector outer product. If an input isn't a vector, we flatten it first. | def outer(x, y):
if x.ndim != 1:
x = x.flatten()
if y.ndim != 1:
y = y.flatten()
return dot(
x.dimshuffle(0, 'x'),
y.dimshuffle('x', 0)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def outer_product(x):\n return keras.backend.batch_dot(\n x[0]\n , x[1]\n , axes=[1,1]\n ) / x[0].get_shape().as_list()[1]",
"def outer_product(x,y):\n\n return x[:,0]*y[:,1] -x[:,1]*y[:,0]",
"def outer_product(u: Vector3D, v: Vector3D):\n cx = u... | [
"0.7179019",
"0.680826",
"0.6666531",
"0.6636183",
"0.6615202",
"0.63013345",
"0.6297066",
"0.6200343",
"0.619846",
"0.6177746",
"0.6160142",
"0.6123019",
"0.6111182",
"0.6100941",
"0.60843045",
"0.60737896",
"0.60377026",
"0.6033435",
"0.6007617",
"0.59786195",
"0.59701717",... | 0.6320958 | 5 |
Range of values (maximum minimum) along an axis. The name of the function comes from the acronym for peak to peak. | def ptp(a, axis=None):
a = as_tensor_variable(a)
out = max(a, axis) - min(a, axis)
return out | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _bound(x, min_value, max_value):\n return np.maximum(min_value, np.minimum(x, max_value))",
"def data_range(x):\n return max(x)-min(x)",
"def _get_limit_func(self, axis):\n limits = self.motion_limits[axis.lower()]\n limits = limits['lower'], limits['upper']\n\n def limit_fun... | [
"0.7082566",
"0.6984887",
"0.69073766",
"0.68797976",
"0.6837881",
"0.6725768",
"0.6704519",
"0.6644796",
"0.6496203",
"0.64865017",
"0.6480655",
"0.64441895",
"0.6443104",
"0.6413776",
"0.6372962",
"0.63301337",
"0.63096154",
"0.62902486",
"0.62825954",
"0.6267478",
"0.62588... | 0.0 | -1 |
zz < beta aa + alpha dot(xx, yy) where xx is a matrix, yy and aa are vectors (ergo zz is vector) | def gemv_c_code(aa, xx, yy, zz, alpha, beta, destructive, fail):
return """
int elemsize ;
float fbeta;
double dbeta;
if (PyArray_NDIM(%(aa)s) != 1)
{
PyErr_SetString(PyExc_NotImplementedError, "Gemv: rank(aa) != 1");
%(fail)s;
}
if (PyArray_NDIM(%(xx)s) != ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dot(a, b):\n return np.vdot(a.arr,b.arr)",
"def vdot(a, b):\n return np.vdot(a.ravel(), b.ravel())",
"def dot(vector01,vector02):\r\n result = 0\r\n # creates the initial value for the result of the dot product\r\n for z in range(len(vector01)):\r\n # for loop which continues as long as t... | [
"0.7138466",
"0.69835967",
"0.69659966",
"0.67912626",
"0.6767096",
"0.6742642",
"0.6705978",
"0.6700798",
"0.6700564",
"0.66798806",
"0.666628",
"0.6578934",
"0.65192306",
"0.6511458",
"0.64970386",
"0.6483338",
"0.64360845",
"0.6425533",
"0.6419481",
"0.641725",
"0.6387452"... | 0.0 | -1 |
Returns a list containing a C expression representing the stride for each dimension of the ith variable, in the specified loop_order. | def get_loop_strides(loop_order, i):
var = sub["lv%i" % i]
r = []
for index in loop_order:
# Note: the stride variable is not declared for broadcasted variables
if index != 'x':
r.append("%(var)s_stride%(index)s" % locals())
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_declare(loop_orders, dtypes, sub):\r\n\r\n decl = \"\"\r\n for i, (loop_order, dtype) in enumerate(zip(loop_orders, dtypes)):\r\n var = sub['lv%i' % i] # input name corresponding to ith loop variable\r\n # we declare an iteration variable\r\n # and an integer for the number of d... | [
"0.5944035",
"0.5569722",
"0.54855853",
"0.5483344",
"0.53565174",
"0.53291947",
"0.53280866",
"0.5270426",
"0.52499413",
"0.52193487",
"0.52116627",
"0.52103895",
"0.5201823",
"0.51786625",
"0.51761234",
"0.5148792",
"0.5148792",
"0.511541",
"0.5060361",
"0.5048173",
"0.4963... | 0.85287625 | 0 |
Return the cumulative sum of the elements along a given axis. Wraping of numpy.cumsum. | def cumsum(x, axis=None):
return CumsumOp(axis=axis)(x) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cumsum(tensor, axis=None):\n raise NotImplementedError",
"def cumsumr(x, axis=0):\n cums = x.cumsum(axis=axis)\n return cums - np.maximum.accumulate(cums*(x == 0), axis=axis)",
"def cumsum(\n self,\n dim: Dims = None,\n *,\n skipna: bool | None = None,\n keep... | [
"0.8088054",
"0.78637165",
"0.739014",
"0.739014",
"0.739014",
"0.71655923",
"0.70903116",
"0.70903116",
"0.70903116",
"0.69771016",
"0.6948737",
"0.68090373",
"0.67847306",
"0.67801255",
"0.67272663",
"0.6574897",
"0.6561483",
"0.65502715",
"0.6412482",
"0.6371081",
"0.63648... | 0.86210084 | 0 |
Return the cumulative product of the elements along a given axis. Wraping of numpy.cumprod. | def cumprod(x, axis=None):
return CumprodOp(axis=axis)(x) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cumprod(a, axis=None, dtype=None, out=None):\n a = astensor(a)\n if dtype is None:\n dtype = np.empty((1,), dtype=a.dtype).cumprod().dtype\n op = TensorCumprod(axis=axis, dtype=dtype)\n return op(a, out=out)",
"def cumprod(x, dim=-1, exclusive=False):\n if exclusive:\n length = x... | [
"0.83122087",
"0.7678079",
"0.7422974",
"0.7422974",
"0.7422974",
"0.73245317",
"0.708226",
"0.70139104",
"0.70139104",
"0.70139104",
"0.6992349",
"0.69838285",
"0.68050027",
"0.6483811",
"0.63858706",
"0.63452077",
"0.630044",
"0.6292007",
"0.6223953",
"0.6139547",
"0.602112... | 0.8767635 | 0 |
Remove broadcastable dimensions from the shape of an array. It returns the input array, but with the broadcastable dimensions removed. This is always `x` itself or a view into `x`. | def squeeze(x):
view = x.dimshuffle([i for i in range(x.ndim)
if not x.broadcastable[i]])
return view | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def broadcast_to(x, shape):\n if x.shape == shape:\n return chainer.as_variable(x)\n y, = BroadcastTo(shape).apply((x,))\n return y",
"def unbroadcast(x, *axes):\r\n rval = Rebroadcast(*[(axis, False) for axis in axes])(x)\r\n return theano.tensor.opt.apply_rebroadcast_opt(rval)",
"def re... | [
"0.6910688",
"0.65722287",
"0.63888425",
"0.63716173",
"0.6152199",
"0.5996176",
"0.59684163",
"0.5896834",
"0.58574384",
"0.5822257",
"0.57931805",
"0.57726055",
"0.57359546",
"0.5715103",
"0.56911117",
"0.56820625",
"0.5651555",
"0.5636748",
"0.5607484",
"0.55821824",
"0.55... | 0.72430676 | 0 |
Repeat elements of an array. It returns an array which has the same shape as `x`, except along the given axis. The axis is used to speficy along which axis to repeat values. By default, use the flattened input array, and return a flat output array. The number of repetitions for each element is `repeat`. `repeats` is br... | def repeat(x, repeats, axis=None):
return RepeatOp(axis=axis)(x, repeats) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def repeat_elements(x, rep, axis):\n x_shape = x.get_shape().as_list()\n if x_shape[axis] is None:\n raise ValueError('Axis ' + str(axis) + ' of input tensor '\n 'should have a defined dimension, but is None. '\n 'Full tensor shape: ' + str(tuple(x_shape... | [
"0.7905797",
"0.7851135",
"0.72033536",
"0.71346915",
"0.6743669",
"0.66946703",
"0.6484287",
"0.6321837",
"0.6294865",
"0.6273246",
"0.6252801",
"0.6180603",
"0.6150083",
"0.6136543",
"0.6111009",
"0.5995302",
"0.5955362",
"0.5925612",
"0.5892735",
"0.5811557",
"0.5804485",
... | 0.7901454 | 1 |
Returns a copy of an array with all elements of the main diagonal set to a specified scalar value. | def fill_diagonal(a, val):
return fill_diagonal_(a, val) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_diagonal(self, value = 0):\n for d in range(self.size):\n self.write(d, d, value)",
"def diagonal(self) -> Float[Array, \" N\"]:\n return self.value * jnp.ones(self.size)",
"def create_diagonal(m: NumpyRealArray) -> NumpyRealArray:\n indices = (..., *np.diag_indices(m.shape[... | [
"0.6305295",
"0.619083",
"0.60137206",
"0.5969221",
"0.59568155",
"0.5902832",
"0.586513",
"0.58496666",
"0.58329",
"0.5778733",
"0.5772161",
"0.5763603",
"0.5759463",
"0.57361263",
"0.5711557",
"0.57068056",
"0.56852216",
"0.5659557",
"0.56288046",
"0.5591368",
"0.55752885",... | 0.64218944 | 0 |
Initializes a ConvOp with given output_mode (full/valid). All other parameters are optional and are only used to generate more optimized c code. | def __init__(self, imshp=None, kshp=None, nkern=None, bsize=None,
dx=1, dy=1,
output_mode='valid',
unroll_batch=None,
unroll_kern=None,
unroll_patch=None,
imshp_logical=None,
kshp_logical=None... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, in_channels, out_channels, kernel_size, padding=0, **kwargs):\n ConstrainedLayer.__init__(self, nn.Conv2d(in_channels, out_channels, kernel_size, padding=padding, bias=False), **kwargs)",
"def __init__(self, n_dim: int, norm_layer: str, in_channels: int,\n start_filts: i... | [
"0.6082901",
"0.59774387",
"0.5934655",
"0.5906694",
"0.58517915",
"0.58126557",
"0.5804472",
"0.5730675",
"0.56428945",
"0.5637448",
"0.5632715",
"0.56001353",
"0.5586386",
"0.557567",
"0.5555289",
"0.5551989",
"0.55497056",
"0.5546297",
"0.55164784",
"0.5486186",
"0.5460427... | 0.64836663 | 0 |
This function create optimizer that move some inputs to the GPU for op that work on both CPU and GPU. The op object is created by calling op(), so good default value are needed. We suppose the same op work with CPU and GPU inputs. | def make_gpu_optimizer(op, to_gpu):
@theano.gof.local_optimizer([op, cuda.gpu_from_host])
def local_to_gpu(node):
"""
op(host_from_gpu()) -> host_from_gpu(op)
gpu_from_host(op) -> op(gpu_from_host)
"""
if isinstance(node.op, op):
#op(host_from_gpu()) -... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _add_train_op(self):\n with tf.device(\"/gpu:0\"):\n learning_rate_D = 0.0004 # tf.train.exponential_decay(0.001, self.global_step_D,\n # 100000, 0.96, staircase=True)\n learning_rate_G = 0.0004 # tf.train.exponential_decay(0.001, self.global_step_G... | [
"0.67647284",
"0.6605623",
"0.6605623",
"0.6531885",
"0.63354367",
"0.6328149",
"0.63051903",
"0.62737834",
"0.62638766",
"0.6246429",
"0.62078756",
"0.6198335",
"0.618852",
"0.61847764",
"0.6179345",
"0.61249906",
"0.6070329",
"0.60668814",
"0.6065136",
"0.6057832",
"0.60526... | 0.76324254 | 0 |
Try to turn softmax(sum_of_stuff) > softmax_w_bias(matrix, bias) | def local_softmax_with_bias(node):
if node.op == softmax:
x, = node.inputs
if x.owner and x.owner.op == tensor.add:
vectors = []
non_vectors = []
for x_in in x.owner.inputs:
if list(x_in.type.broadcastable) == [True, False]:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def softmax(z):\n a = np.exp(z) / np.exp(z).sum(axis=0)\n assert z.shape[1] == sum(np.isclose(a.sum(axis=0), 1))\n # to predict use\n # a = (a >= 0.5).astype(np.int)\n return a, z",
"def softmax(x):\r\n e_x = np.exp(x - np.expand_dims(np.max(x, axis=-1), axis=-1))\r\n return e_x / np.expand_... | [
"0.665045",
"0.6577913",
"0.6570623",
"0.65701246",
"0.65613663",
"0.6556821",
"0.6548129",
"0.65392363",
"0.6517522",
"0.6516176",
"0.65126735",
"0.6510584",
"0.6510584",
"0.6510584",
"0.6510584",
"0.6509158",
"0.65060353",
"0.65060353",
"0.65060353",
"0.65060353",
"0.650603... | 0.66652536 | 0 |
Compute the crossentropy of binary random variables output and target are each expectations of binary random variables; target may be exactly 0 or 1 but output must lie strictly between 0 and 1. | def binary_crossentropy(output, target):
return -(target * tensor.log(output) + (1.0 - target) * tensor.log(1.0 - output)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def binary_cross_entropy(input: Tensor, target: Tensor) -> Tensor:\n assert input.shape == target.shape, 'input and target have different shape!'\n assert len(input.shape) == 2, 'binary cross entropy only used in 2 dim matrix'\n assert input.shape[1] == 1, 'binary shape[1] should be 1'\n loss = target ... | [
"0.7407761",
"0.7360902",
"0.72255766",
"0.7221045",
"0.71571857",
"0.7114386",
"0.69878495",
"0.68946356",
"0.68628377",
"0.68507403",
"0.67942005",
"0.67397535",
"0.6671272",
"0.6584777",
"0.65830106",
"0.6582352",
"0.65615785",
"0.6548534",
"0.6548534",
"0.65443486",
"0.65... | 0.8066527 | 0 |
An approximation of sigmoid. More approximate and faster than ultra_fast_sigmoid. | def hard_sigmoid(x):
slope = 0.2
shift = 0.5
x = (x * slope) + shift
x = tensor.clip(x, 0, 1)
return x | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sigmoid(x):\n return 1 / (1 + math.exp(-x))",
"def sigmoid(x):\n return 1 / (1 + exp(-x))",
"def sigmoid(x):\n return 1 / (1 + exp(-x))",
"def sigmoid(x):\r\n return 1 / (1 + np.exp(-x))",
"def sigmoid(x):\n return 1 / (1 + math.exp(-x))",
"def sigmoid(x):\n\n return 1 / (1 + math.exp... | [
"0.84069246",
"0.8392541",
"0.8392541",
"0.8376915",
"0.83760875",
"0.8358859",
"0.8358859",
"0.834778",
"0.8347289",
"0.83411247",
"0.83411247",
"0.83411247",
"0.83411247",
"0.83411247",
"0.83411247",
"0.83268327",
"0.83250123",
"0.831202",
"0.83109504",
"0.83070487",
"0.830... | 0.0 | -1 |
Match a variable with the `x` pattern. | def is_neg(var):
apply = var.owner
if not apply:
return None
# First match against `tensor.neg`.
if apply.op == tensor.neg:
return apply.inputs[0]
# Then match against a multiplication by -1.
if apply.op == tensor.mul and len(apply.inputs) >= 2:
for idx, mul_inpu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_isxpred(x):\n rematch = re.match\n pat = re.compile(r\"^{}\\d*$\".format(x))\n return lambda s: rematch(pat, s)",
"def _check_variable(string, varname):\r\n prefix = '[(, ]' # Any character with the exception of '(, '\r\n suffix = '[), ]' # Any character with the exception of '), '\r\n ... | [
"0.63832235",
"0.6366173",
"0.57775444",
"0.57327634",
"0.5613515",
"0.54353154",
"0.53413796",
"0.53167504",
"0.52916336",
"0.52801794",
"0.5270872",
"0.52574795",
"0.525641",
"0.52364314",
"0.51793957",
"0.51779616",
"0.51124203",
"0.51027817",
"0.50562346",
"0.50427806",
"... | 0.0 | -1 |
(unroll_kern, unroll_batch) in (0,1),(1,0) is special case. | def test_unroll_special(self):
self.validate((6, 2, 3, 3), (3, 2, 2, 2), 'valid', unroll_batch=1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_unroll_batch_kern(self):\r\n # mini-batch of size 6 is multiple of 2 and 3. Should work.\r\n self.validate((6, 2, 3, 3), (3, 2, 2, 2), 'valid',\r\n unroll_batch=2, unroll_kern=3, verify_grad=False)\r\n self.validate((6, 2, 3, 3), (3, 2, 2, 2), 'valid',\r\n unro... | [
"0.75431097",
"0.7231089",
"0.718228",
"0.65746933",
"0.6172582",
"0.609834",
"0.56605285",
"0.5169804",
"0.51501673",
"0.5135688",
"0.5116371",
"0.50963366",
"0.50712436",
"0.50633097",
"0.50577205",
"0.50263286",
"0.49807513",
"0.49544933",
"0.49491745",
"0.49215892",
"0.49... | 0.5785622 | 6 |
dot(x,y).T > dot(y.T, x.T) These optimizations "lift" (propagate towards the inputs) DimShuffle through dot product. It allows to put the graph in a more standard shape, and to later merge consecutive DimShuffles. The transformation should be apply whether or not the transpose is inplace. The newlyintroduced transposit... | def local_lift_transpose_through_dot(node):
if not (isinstance(node.op, T.DimShuffle)
and node.op.new_order == (1, 0)):
return False
if not (node.inputs[0].owner
and isinstance(node.inputs[0].owner.op, T.Dot)):
return False
x, y = node.inputs[0].owner.inputs
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pairwise_dot_product_similarity(x, y):\n return torch.mm(x, torch.transpose(y, 1, 0))",
"def local_gpu_dot_to_dot22(node):\r\n\r\n # In case the got do input upcast, we much check that we can\r\n # make it run on the gpu.\r\n if isinstance(node.op, GpuFromHost):\r\n if node.outputs[0].type... | [
"0.56074953",
"0.55900526",
"0.5426788",
"0.5411452",
"0.5403642",
"0.53627264",
"0.5355435",
"0.5303145",
"0.52808696",
"0.52366036",
"0.52277964",
"0.5223949",
"0.52134687",
"0.52104163",
"0.52066845",
"0.51808906",
"0.51504815",
"0.51176137",
"0.5101976",
"0.50926554",
"0.... | 0.7084865 | 0 |
Return a list of shape tuple or None for the outputs of node. This function is used for Ops that don't implement infer_shape. Ops that do implement infer_shape should use the i_shapes parameter, but this default implementation ignores it. | def default_infer_shape(self, node, i_shapes):
rval = []
for r in node.outputs:
try:
rval.append(self.shape_tuple(r))
except AttributeError:
rval.append(None)
return rval | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_output_shape(self):\n return []",
"def getOutShapes(self):\n\t\treturn self.output_shape",
"def infer_outputs(self):\n # TF lack a supported API for invoking shape inference directly,\n # so we instantiate a dummy graph and create a dummy Operation object\n temp_graph = tf.Graph()\n ... | [
"0.72548044",
"0.7233069",
"0.7186948",
"0.70564955",
"0.70564955",
"0.69700783",
"0.69554716",
"0.68077296",
"0.67231786",
"0.67209417",
"0.6647989",
"0.6597966",
"0.6527242",
"0.65256137",
"0.65093577",
"0.65093577",
"0.65093577",
"0.6403167",
"0.6403167",
"0.6400996",
"0.6... | 0.86986 | 0 |
fill(s,v) > alloc(v, shape(s)) This is an important optimization because with the shape_to_shape_i optimization, the dependency on 's' is often removed. | def local_fill_to_alloc(node):
if node.op == T.fill:
r, v = node.inputs
if v.type == node.outputs[0].type:
# this is a useless fill, erase it.
rval = [v]
elif v.type.broadcastable == node.outputs[0].type.broadcastable:
# this is a cast
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pfill(self, v=0, s=None):\n s = _successor(v - 1) if s is None else s\n try:\n return plist([x.pfill(s=s) for x in self], root=self.__root__)\n except Exception:\n return plist([s.s() for _ in range(len(self))], root=self.__root__)",
"def Fill(self, v: 'double const &') -> \"void\":\n ... | [
"0.6219492",
"0.6130823",
"0.6041881",
"0.5945045",
"0.59025776",
"0.5736687",
"0.57223684",
"0.5717646",
"0.5658104",
"0.5637345",
"0.5559896",
"0.5557889",
"0.5525543",
"0.5523119",
"0.5491261",
"0.5485876",
"0.5484592",
"0.54832137",
"0.5437007",
"0.53829783",
"0.5380721",... | 0.60379535 | 3 |
When using Subtensor, gradient graphs can be ugly. If we ask for grad(f(a[0]), a), we are going to get something like IncSubtensor(Elemwise{second}(a, 0), g(f(a[0])), [0]) This might be ugly, but at least it's as fast as you could want. If we ask for grad(f(a[0], a[1], a[2]), a), it's much worse... Elemwise{Add} IncSub... | def local_IncSubtensor_serialize(node):
def movable(i):
# Return True iff this is a incsubtensor that we can move
return i.owner \
and isinstance(i.owner.op, IncSubtensor) \
and i.type == o_type \
and len(i.clients) == 1 \
and no... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_advinc_subtensor1():\r\n for shp in [(3, 3), (3, 3, 3)]:\r\n shared = cuda.shared_constructor\r\n xval = numpy.arange(numpy.prod(shp), dtype='float32').reshape(shp) + 1\r\n yval = numpy.empty((2,) + shp[1:], dtype='float32')\r\n yval[:] = 10\r\n x = shared(xval, name=... | [
"0.7311381",
"0.726762",
"0.65375316",
"0.61712587",
"0.6162492",
"0.61005425",
"0.5970585",
"0.580121",
"0.57438713",
"0.5734978",
"0.5651211",
"0.56492525",
"0.5630664",
"0.5626155",
"0.55818206",
"0.5578537",
"0.55719185",
"0.55419767",
"0.5538248",
"0.5518715",
"0.5514387... | 0.5681739 | 10 |
f(fill(a,b), c) > f(b, c) If c.type == a.type. | def local_fill_cut(node):
# this optimization is essentially for getting broadcasting to
# replace fill. This is always possible when using a Compound
# Elemwise operation, but it is not always possible without one
# (consider filling a large matrix with a scalar, and then adding
# another s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __gt__(self, other):\n return self.__f > other.get_f()",
"def test_compare(self): \n d1 = heat(\n np.array([[0.5, 1]]),\n np.array([[0.5, 1.1]])\n )\n d2 = heat(\n np.array([[0.5, 1]]),\n np.array([[0.5, 1.5]])\n )\n\n ... | [
"0.62218684",
"0.6158055",
"0.6149237",
"0.6035814",
"0.60219777",
"0.5965674",
"0.596537",
"0.59017414",
"0.59003973",
"0.5880855",
"0.5876454",
"0.5855536",
"0.58383733",
"0.5827772",
"0.5825342",
"0.5802748",
"0.57955754",
"0.5794337",
"0.57765126",
"0.5773194",
"0.5766302... | 0.0 | -1 |
Returns a numeric constant if v is a Constant or, well, a numeric constant. If v is a plain Variable, returns None. | def get_constant(v):
if isinstance(v, Variable):
try:
return get_scalar_constant_value(v)
except NotScalarConstantError:
return None
else:
return v | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maybe_float(v):\n try:\n return float(v)\n except ValueError:\n return v",
"def _canCompute(v):\n\n if isinstance(v, int):\n return None\n elif isinstance(v, float):\n return None\n elif isinstance(v, bool)... | [
"0.6041223",
"0.57718927",
"0.5707443",
"0.56300414",
"0.5617949",
"0.5603829",
"0.55203295",
"0.5516821",
"0.549288",
"0.5484174",
"0.5473629",
"0.5457636",
"0.545753",
"0.5452573",
"0.5414045",
"0.53109163",
"0.5283095",
"0.52805704",
"0.52485985",
"0.524832",
"0.52172524",... | 0.8268902 | 0 |
Remove reduction over broadcastable dimensions | def local_reduce_broadcastable(node):
if isinstance(node.op, T.CAReduce):
reduced, = node.inputs
odtype = node.outputs[0].dtype
if node.op.axis is None:
if all(reduced.broadcastable):
return [reduced.dimshuffle().astype(odtype)]
else:
a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unbroadcast(x, *axes):\r\n rval = Rebroadcast(*[(axis, False) for axis in axes])(x)\r\n return theano.tensor.opt.apply_rebroadcast_opt(rval)",
"def test_unbroadcast_addbroadcast(self):\r\n\r\n x = matrix()\r\n assert unbroadcast(x, 0) is x\r\n assert unbroadcast(x, 1) is x\r\n ... | [
"0.69065136",
"0.65811175",
"0.63607335",
"0.6356695",
"0.6299634",
"0.6251727",
"0.6243049",
"0.6127722",
"0.611191",
"0.60232",
"0.60226035",
"0.5971425",
"0.59434617",
"0.5943401",
"0.5885413",
"0.5863937",
"0.5857142",
"0.58525014",
"0.5827904",
"0.57710314",
"0.56971705"... | 0.6748207 | 1 |
Sample from a uniform distribution between low and high. If the size argument is ambiguous on the number of dimensions, ndim may be a plain integer to supplement the missing information. If size is None, the output shape will be determined by the shapes of low and high. If dtype is not specified, it will be inferred fr... | def uniform(random_state, size=None, low=0.0, high=1.0, ndim=None, dtype=None):
low = tensor.as_tensor_variable(low)
high = tensor.as_tensor_variable(high)
if dtype is None:
dtype = tensor.scal.upcast(theano.config.floatX, low.dtype, high.dtype)
ndim, size, bcast = _infer_ndim_bcast(ndim, s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def uniform(self, size, low=0.0, high=1.0, ndim=None, dtype=None,\r\n nstreams=None):\r\n low = as_tensor_variable(low)\r\n high = as_tensor_variable(high)\r\n if dtype is None:\r\n dtype = scal.upcast(config.floatX, low.dtype, high.dtype)\r\n\r\n low = cast(lo... | [
"0.74183303",
"0.7340833",
"0.6916504",
"0.6825456",
"0.6676929",
"0.63203675",
"0.62424517",
"0.6140481",
"0.6140481",
"0.6080059",
"0.6068512",
"0.6020926",
"0.6020926",
"0.5973936",
"0.58061165",
"0.5750866",
"0.5747881",
"0.5736343",
"0.5731381",
"0.57049733",
"0.5646579"... | 0.67572325 | 4 |
Sample from a normal distribution centered on avg with the specified standard deviation (std). If the size argument is ambiguous on the number of dimensions, ndim may be a plain integer to supplement the missing information. If size is None, the output shape will be determined by the shapes of avg and std. If dtype is ... | def normal(random_state, size=None, avg=0.0, std=1.0, ndim=None, dtype=None):
avg = tensor.as_tensor_variable(avg)
std = tensor.as_tensor_variable(std)
if dtype is None:
dtype = tensor.scal.upcast(theano.config.floatX, avg.dtype, std.dtype)
ndim, size, bcast = _infer_ndim_bcast(ndim, size, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normal(self, size=None, avg=0.0, std=1.0, ndim=None, dtype=None):\r\n return self.gen(normal, size, avg, std, ndim=ndim, dtype=dtype)",
"def normal(self, size=None, avg=0.0, std=1.0, ndim=None,\r\n dtype=config.floatX):\r\n if isinstance(size, tuple):\r\n msg = \"size must... | [
"0.7804149",
"0.72467744",
"0.66956216",
"0.64533883",
"0.6290135",
"0.6243971",
"0.62228096",
"0.62201494",
"0.61338",
"0.6110815",
"0.610494",
"0.61028147",
"0.6094721",
"0.608746",
"0.60828257",
"0.60828257",
"0.6069534",
"0.60424936",
"0.60325724",
"0.6023944",
"0.6023894... | 0.6919889 | 2 |
Sample a random integer between low and high, both inclusive. If the size argument is ambiguous on the number of dimensions, ndim may be a plain integer to supplement the missing information. If size is None, the output shape will be determined by the shapes of low and high. | def random_integers(random_state, size=None, low=0, high=1, ndim=None,
dtype='int64'):
low = tensor.as_tensor_variable(low)
high = tensor.as_tensor_variable(high)
ndim, size, bcast = _infer_ndim_bcast(ndim, size, low, high)
op = RandomFunction(random_integers_helper,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_integers(self, size=None, low=0, high=1, ndim=None,\r\n dtype='int64'):\r\n return self.gen(random_integers, size, low, high, ndim=ndim,\r\n dtype=dtype)",
"def rand_sample(self, high, size=None, replace=True):\n\n a = np.arange(high)\n ... | [
"0.68567365",
"0.65204203",
"0.6362708",
"0.6229897",
"0.6092404",
"0.6092404",
"0.6092404",
"0.6092404",
"0.6079233",
"0.6056344",
"0.605569",
"0.5969942",
"0.59608746",
"0.5846641",
"0.581724",
"0.5779632",
"0.5773101",
"0.57647216",
"0.5764186",
"0.5723979",
"0.568779",
... | 0.6304202 | 3 |
Choose values from `a` with or without replacement. `a` can be a 1D array or a positive scalar. If `a` is a scalar, the samples are drawn from the range 0,...,a1. If the size argument is ambiguous on the number of dimensions, ndim may be a plain integer to supplement the missing information. If size is None, a scalar w... | def choice(random_state, size=None, a=2, replace=True, p=None, ndim=None,
dtype='int64'):
# numpy.random.choice is only available for numpy versions >= 1.7
major, minor, _ = numpy.version.short_version.split('.')
if (int(major), int(minor)) < (1, 7):
raise ImportError('choice require... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def choice_helper(random_state, a, replace, p, size):\r\n if a.ndim > 1:\r\n raise ValueError('a.ndim (%i) must be 0 or 1' % a.ndim)\r\n if p.ndim == 1:\r\n if p.size == 0:\r\n p = None\r\n else:\r\n raise ValueError('p.ndim (%i) must be 1' % p.ndim)\r\n replace = bool(r... | [
"0.64968336",
"0.64352095",
"0.5946004",
"0.58982784",
"0.5696262",
"0.5632979",
"0.56060755",
"0.54650396",
"0.5442307",
"0.52584743",
"0.52197987",
"0.5176258",
"0.5163186",
"0.50513935",
"0.5031219",
"0.5005607",
"0.49606544",
"0.4941378",
"0.4941378",
"0.48949176",
"0.488... | 0.5527337 | 7 |
Sample a tensor of given size whose element from a uniform distribution between low and high. If the size argument is ambiguous on the number of dimensions, ndim may be a plain integer to supplement the missing information. | def uniform(self, size=None, low=0.0, high=1.0, ndim=None, dtype=None):
return self.gen(uniform, size, low, high, ndim=ndim, dtype=dtype) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sample(self, *size):\n if len(size) == 1 and isinstance(size[0], Sequence):\n size = size[0]\n size = list(size) + [self.dim]\n\n sample = torch.randn(size, device=self.mu.device) * self.sigma2.sqrt() + self.mu\n return sample",
"def uniform(random_state, size=None, low... | [
"0.69612116",
"0.688523",
"0.6873488",
"0.6818431",
"0.655707",
"0.6527784",
"0.6477835",
"0.6275151",
"0.6275151",
"0.62724054",
"0.6265774",
"0.6090983",
"0.6034663",
"0.6033419",
"0.5954965",
"0.59302866",
"0.5900066",
"0.58472735",
"0.58472735",
"0.58472735",
"0.58472735"... | 0.69291496 | 1 |
Sample from a normal distribution centered on avg with the specified standard deviation (std). If the size argument is ambiguous on the number of dimensions, ndim may be a plain integer to supplement the missing information. | def normal(self, size=None, avg=0.0, std=1.0, ndim=None, dtype=None):
return self.gen(normal, size, avg, std, ndim=ndim, dtype=dtype) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def normal(self, size=None, avg=0.0, std=1.0, ndim=None,\r\n dtype=config.floatX):\r\n if isinstance(size, tuple):\r\n msg = \"size must be a tuple of int or a Theano variable\"\r\n assert all([isinstance(i, int) or isinstance(i, Variable)\r\n for i in size]),... | [
"0.71150047",
"0.67193335",
"0.66319096",
"0.66168314",
"0.65953463",
"0.65169764",
"0.6495345",
"0.6468297",
"0.6427155",
"0.642378",
"0.6405496",
"0.63952595",
"0.6369784",
"0.6328297",
"0.6313905",
"0.6308408",
"0.6299369",
"0.6277791",
"0.62638444",
"0.62189686",
"0.62115... | 0.7604858 | 0 |
Sample a random integer between low and high, both inclusive. If the size argument is ambiguous on the number of dimensions, ndim may be a plain integer to supplement the missing information. | def random_integers(self, size=None, low=0, high=1, ndim=None,
dtype='int64'):
return self.gen(random_integers, size, low, high, ndim=ndim,
dtype=dtype) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_integers(random_state, size=None, low=0, high=1, ndim=None,\r\n dtype='int64'):\r\n low = tensor.as_tensor_variable(low)\r\n high = tensor.as_tensor_variable(high)\r\n ndim, size, bcast = _infer_ndim_bcast(ndim, size, low, high)\r\n op = RandomFunction(random_integers_help... | [
"0.6381298",
"0.63602525",
"0.63169706",
"0.62502813",
"0.60300237",
"0.5976525",
"0.5971976",
"0.5970042",
"0.59503394",
"0.59503394",
"0.59503394",
"0.59503394",
"0.59271485",
"0.5922207",
"0.58799183",
"0.5841259",
"0.57875896",
"0.5759404",
"0.57482296",
"0.5716975",
"0.5... | 0.69511074 | 0 |
Choose values from `a` with or without replacement. `a` can be a 1D array or a positive scalar. If `a` is a scalar, the samples are drawn from the range 0,...,a1. If the size argument is ambiguous on the number of dimensions, ndim may be a plain integer to supplement the missing information. | def choice(self, size=None, a=2, replace=True, p=None, ndim=None,
dtype='int64'):
return self.gen(choice, size, a, replace, p, ndim=ndim, dtype=dtype) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def choice_helper(random_state, a, replace, p, size):\r\n if a.ndim > 1:\r\n raise ValueError('a.ndim (%i) must be 0 or 1' % a.ndim)\r\n if p.ndim == 1:\r\n if p.size == 0:\r\n p = None\r\n else:\r\n raise ValueError('p.ndim (%i) must be 1' % p.ndim)\r\n replace = bool(r... | [
"0.63971084",
"0.6061791",
"0.56832933",
"0.56604326",
"0.5510457",
"0.5414442",
"0.5358317",
"0.53423333",
"0.5222606",
"0.5191182",
"0.5182678",
"0.5164783",
"0.5155914",
"0.50927645",
"0.5038196",
"0.5035087",
"0.49847448",
"0.49411866",
"0.49006328",
"0.48829064",
"0.4864... | 0.59553915 | 2 |
Takes as input a ND tensor, where N >= 2. It downscales the input image by the specified factor, by keeping only the maximum value of nonoverlapping patches of size (ds[0],ds[1]) | def max_pool_2d(input, ds, ignore_border=False):
if input.ndim < 2:
raise NotImplementedError('max_pool_2d requires a dimension >= 2')
# extract image dimensions
img_shape = input.shape[-2:]
# count the number of "leading" dimensions, store as dmatrix
batch_size = tensor.prod(input... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def downsample_with_max_pooling(array, factor):\n factor = validate_factor(array, factor)\n if np.all(np.array(factor, int) == 1):\n return array\n\n sections = []\n\n for offset in np.ndindex(factor):\n part = array[tuple(np.s_[o::f] for o, f in zip(offset, factor))]\n sections.ap... | [
"0.668152",
"0.6418026",
"0.62154573",
"0.61439455",
"0.59898174",
"0.5943476",
"0.5935464",
"0.59258676",
"0.5905643",
"0.5876259",
"0.5844549",
"0.5835336",
"0.58106554",
"0.57757187",
"0.5715399",
"0.5703882",
"0.5703882",
"0.56976384",
"0.56867546",
"0.56867546",
"0.56867... | 0.66831064 | 0 |
Test that conv2d fails for dimensions other than 2 or 3. | def test_fail(self):
self.assertRaises(Exception, conv.conv2d, T.dtensor4(), T.dtensor3())
self.assertRaises(Exception, conv.conv2d, T.dtensor3(), T.dvector()) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_conv2d_failure(shape, pad, stride, dilation, err_msg):\n np.random.seed(0)\n\n kernel_size = (2, 2)\n groups = 1\n dtype = \"uint8\"\n out_channels = 8\n weight_format = \"HWIO\"\n\n model, _ = _get_model(\n shape,\n kernel_size[0],\n kernel_size[1],\n 0,\n... | [
"0.7518518",
"0.73233813",
"0.6805942",
"0.68052137",
"0.6776108",
"0.667939",
"0.66713107",
"0.66430485",
"0.6630016",
"0.65922314",
"0.65768725",
"0.6568516",
"0.6562342",
"0.6499656",
"0.6476626",
"0.64437336",
"0.6414923",
"0.640701",
"0.63890606",
"0.6366492",
"0.6362011... | 0.6783312 | 4 |
Returns the indices that would sort an array. Perform an indirect sort along the given axis using the algorithm specified by the kind keyword. It returns an array of indices of the same shape as a that index data along the given axis in sorted order. | def argsort(a, axis=-1, kind='quicksort', order=None):
return ArgSortOp(kind, order)(a, axis) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def argsort(self, axis=-1, kind=None, order=None):\n return self.__array__().argsort(axis, kind, order)",
"def _make_sorter(self, ax):\n np_array = ax.get_values()\n # return np_array.argsort()\n # ax = ax.take(indexer)\n sorter = RocRadixSortDriver()\n sorted_array, ind... | [
"0.6668823",
"0.6193501",
"0.5880919",
"0.5699249",
"0.5627514",
"0.5600407",
"0.5535815",
"0.5468185",
"0.5374806",
"0.53746504",
"0.53145987",
"0.52998704",
"0.5265124",
"0.52013636",
"0.51960516",
"0.5088191",
"0.50834614",
"0.50197774",
"0.49950114",
"0.49824303",
"0.4939... | 0.5982632 | 2 |
Return the idx_list with constant inputs replaced by their python scalar equivalent. May raise `theano.tensor.NotScalarConstantError` if the idx contains nonconstant entries. If allow_partial is True, then entries that are not constant will stay as their input variable rather than raising an exception. None entries are... | def get_constant_idx(self, inputs, allow_partial=False):
real_idx = get_idx_list(inputs, self.idx_list)
def conv(val):
if val is None:
return None
elif isinstance(val, slice):
return slice(conv(val.start),
conv(v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_scalar_constant_value(orig_v, elemwise=True):\r\n v = orig_v\r\n while True:\r\n if v is None:\r\n # None is not a scalar (and many uses of this function seem to depend\r\n # on passing it None)\r\n raise NotScalarConstantError()\r\n\r\n if isinstance(v,... | [
"0.5733402",
"0.4851572",
"0.4777091",
"0.4730114",
"0.46946967",
"0.4681033",
"0.46780312",
"0.46667916",
"0.4658749",
"0.46571246",
"0.46532398",
"0.46448767",
"0.46066365",
"0.4597019",
"0.45328403",
"0.4519519",
"0.4480937",
"0.44623145",
"0.4449806",
"0.4441229",
"0.4432... | 0.7640866 | 0 |
Return subclasses of `cls` in the numpy scalar hierarchy. We only return subclasses that correspond to unique data types. | def get_numeric_subclasses(cls=numpy.number, ignore=None):
if ignore is None:
ignore = []
rval = []
dtype = numpy.dtype(cls)
dtype_num = dtype.num
if dtype_num not in ignore:
# Safety check: we should be able to represent 0 with this data type.
numpy.array(0, dtype=dt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __subkinds__(cls) -> typing.Iterable[type['dsl.Any']]:\n\n def scan(subs: typing.Iterable[type['dsl.Any']]) -> typing.Iterable[type['dsl.Any']]:\n \"\"\"Scan the class subtree of the given types.\n\n Args:\n subs: Iterable of classes to descend from.\n\n R... | [
"0.62815154",
"0.6273682",
"0.62624663",
"0.61561334",
"0.605462",
"0.59469336",
"0.5921624",
"0.5879655",
"0.58228934",
"0.57668763",
"0.57668763",
"0.5750681",
"0.57181984",
"0.57141244",
"0.5688054",
"0.56848115",
"0.5669388",
"0.5666354",
"0.5660647",
"0.56465095",
"0.554... | 0.6889516 | 0 |
Ensure that a zero gradient has the proper shape. | def test_zero_gradient_shape(self):
x = dmatrix()
f = theano.function([x], grad(dscalar(), x,
disconnected_inputs='ignore'))
a = numpy.ones((3, 7))
self.assertTrue((f(a) == 0).all()) # Zero gradient.
self.assertTrue(a.shape == f(a).sha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def grad_zero(self):\r\n pass",
"def grad_zero(self):\r\n pass",
"def validate_gradient(model):\n for name, param in model.named_parameters():\n if param.grad is not None:\n if torch.any(torch.isnan(param.grad)):\n return False\n if torch.any(torch.i... | [
"0.6441957",
"0.6441957",
"0.64301765",
"0.6419833",
"0.64097893",
"0.62636",
"0.6219035",
"0.6175266",
"0.6121719",
"0.61134356",
"0.6071191",
"0.5965988",
"0.5965988",
"0.59518677",
"0.5936335",
"0.5934952",
"0.5931848",
"0.5873332",
"0.5853203",
"0.5813075",
"0.58121175",
... | 0.77060163 | 0 |
Checks that the same Op is returned on repeated calls to arange using the same dtype, but not for different dtypes. | def test_dtype_cache(self):
start, stop, step = iscalars('start', 'stop', 'step')
out1 = arange(start, stop, step)
out2 = arange(start, stop, step, dtype=out1.dtype)
out3 = arange(start, stop, 2., dtype=out1.dtype)
out4 = arange(start, stop, 2.)
assert out1.owne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_upcast(self):\r\n if config.cast_policy == 'custom':\r\n assert arange(iscalar()).dtype == iscalar().dtype\r\n assert arange(fscalar()).dtype == fscalar().dtype\r\n assert arange(dscalar()).dtype == dscalar().dtype\r\n\r\n # int32 + float32 -> float64\r\n... | [
"0.57185197",
"0.5585049",
"0.5574737",
"0.5552548",
"0.5482266",
"0.5443915",
"0.5383702",
"0.5363426",
"0.53165126",
"0.5301947",
"0.5273211",
"0.51865697",
"0.5176233",
"0.51511014",
"0.51362634",
"0.51338303",
"0.5115551",
"0.51092386",
"0.5101257",
"0.5094043",
"0.508840... | 0.66744107 | 0 |
Test that at run time we raise an exception when the shape is not the one specified | def test_bad_shape(self):
specify_shape = SpecifyShape()
x = vector()
xval = numpy.random.rand(2).astype(floatX)
f = theano.function([x], specify_shape(x, [2]), mode=self.mode)
f(xval)
xval = numpy.random.rand(3).astype(floatX)
self.assertRaises(Assertion... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_shape_error(self):\n raise unittest.SkipTest(\"Failing after fixing Poly unsoundness #4878\")\n with self.assertRaisesRegex(TypeError,\n re.escape(\"add got incompatible shapes for broadcasting: (v,), (4,)\")):\n self.CheckShapePolymorphism(\n lambda x, y: ... | [
"0.73011035",
"0.72743607",
"0.7184578",
"0.71830344",
"0.7175446",
"0.7092454",
"0.70786947",
"0.7063437",
"0.70304143",
"0.7029001",
"0.69587475",
"0.6941908",
"0.6919614",
"0.6909269",
"0.68915206",
"0.6888475",
"0.68799603",
"0.6870517",
"0.6863926",
"0.6863926",
"0.68622... | 0.68358326 | 21 |
Test the default dtype of a mean(). | def test_mean_default_dtype(self):
# We try multiple axis combinations even though axis should not matter.
axes = [None, 0, 1, [], [0], [1], [0, 1]]
for idx, dtype in enumerate(imap(str, theano.scalar.all_types)):
axis = axes[idx % len(axes)]
x = tensor.matrix(dtype=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_mean_custom_dtype(self):\r\n # We try multiple axis combinations even though axis should not matter.\r\n axes = [None, 0, 1, [], [0], [1], [0, 1]]\r\n idx = 0\r\n for input_dtype in imap(str, theano.scalar.all_types):\r\n x = tensor.matrix(dtype=input_dtype)\r\n ... | [
"0.7251654",
"0.6349486",
"0.61751187",
"0.60285443",
"0.60285443",
"0.59057087",
"0.58248365",
"0.58177",
"0.5759847",
"0.5749592",
"0.57107157",
"0.5706336",
"0.5692764",
"0.5677569",
"0.5670357",
"0.5637868",
"0.56327325",
"0.56238085",
"0.56145144",
"0.56069815",
"0.55965... | 0.7933754 | 0 |
Test the ability to provide your own output dtype for a mean. | def test_mean_custom_dtype(self):
# We try multiple axis combinations even though axis should not matter.
axes = [None, 0, 1, [], [0], [1], [0, 1]]
idx = 0
for input_dtype in imap(str, theano.scalar.all_types):
x = tensor.matrix(dtype=input_dtype)
for sum_dt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_mean_default_dtype(self):\r\n # We try multiple axis combinations even though axis should not matter.\r\n axes = [None, 0, 1, [], [0], [1], [0, 1]]\r\n for idx, dtype in enumerate(imap(str, theano.scalar.all_types)):\r\n axis = axes[idx % len(axes)]\r\n x = tenso... | [
"0.74046886",
"0.6867922",
"0.6867922",
"0.6213966",
"0.6166151",
"0.61152166",
"0.59718317",
"0.5940347",
"0.5919839",
"0.5919839",
"0.5859232",
"0.5838388",
"0.58119166",
"0.57783973",
"0.57303816",
"0.57190484",
"0.56874704",
"0.5682306",
"0.5680695",
"0.56315076",
"0.5617... | 0.7337974 | 1 |
Test the default dtype of a ProdWithoutZeros(). | def test_prod_without_zeros_default_dtype(self):
# We try multiple axis combinations even though axis should not matter.
axes = [None, 0, 1, [], [0], [1], [0, 1]]
for idx, dtype in enumerate(imap(str, theano.scalar.all_types)):
axis = axes[idx % len(axes)]
x = ProdWi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_base0__dtype(base0, dtype):\n lons, expected = base0\n result = wrap(lons, base=0, dtype=dtype)\n if dtype is None:\n dtype = DTYPE\n np.testing.assert_array_equal(result, expected.astype(dtype))",
"def test_prod_without_zeros_default_acc_dtype(self):\r\n # We try multiple axis... | [
"0.6977063",
"0.67071354",
"0.6521563",
"0.6514407",
"0.6369594",
"0.6369594",
"0.63690287",
"0.63081765",
"0.6278049",
"0.61675435",
"0.61323375",
"0.6125945",
"0.59551805",
"0.59372896",
"0.5927416",
"0.58188915",
"0.5809497",
"0.57981175",
"0.5787499",
"0.57608175",
"0.573... | 0.75324345 | 0 |
Test the default dtype of a ProdWithoutZeros(). | def test_prod_without_zeros_default_acc_dtype(self):
# We try multiple axis combinations even though axis should not matter.
axes = [None, 0, 1, [], [0], [1], [0, 1]]
for idx, dtype in enumerate(imap(str, theano.scalar.all_types)):
axis = axes[idx % len(axes)]
x = te... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_prod_without_zeros_default_dtype(self):\r\n # We try multiple axis combinations even though axis should not matter.\r\n axes = [None, 0, 1, [], [0], [1], [0, 1]]\r\n for idx, dtype in enumerate(imap(str, theano.scalar.all_types)):\r\n axis = axes[idx % len(axes)]\r\n ... | [
"0.7532023",
"0.69769955",
"0.65198535",
"0.65130514",
"0.63693565",
"0.63693565",
"0.6368113",
"0.6309222",
"0.62751985",
"0.61667705",
"0.6130332",
"0.61262417",
"0.59535766",
"0.59355116",
"0.5926064",
"0.5817508",
"0.5808934",
"0.5797716",
"0.57845575",
"0.57604915",
"0.5... | 0.6706225 | 2 |
Create a convolutional model. | def create(window_size=3,
input_dimension=9,
output_vocabsize=8,
n_quadratic_filters=2,
token_representation_size=5,
concatenated_representation_size=7,
lr=0.01,
seed=123,
noise_level=0.2,
qfilter_relscale=0.1,
compile_mode=None):... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_cnn_model() -> tf.keras.Sequential:\n model = Sequential(\n [\n layers.Convolution1D(filters=16, kernel_size=7, input_shape=[186, 1]),\n layers.LeakyReLU(),\n layers.MaxPool1D(pool_size=2),\n layers.Convolution1D(filters=16, kernel_size=5),\n ... | [
"0.77149683",
"0.76388645",
"0.7312063",
"0.7305631",
"0.72645485",
"0.7236626",
"0.70943826",
"0.7093556",
"0.70693207",
"0.7048379",
"0.7035611",
"0.7005012",
"0.69776154",
"0.69685686",
"0.6959582",
"0.6931127",
"0.69277734",
"0.6854178",
"0.68393946",
"0.6831546",
"0.6791... | 0.0 | -1 |
Create a convolutional model. | def create_realistic(window_size=3, # 7,
input_dimension=200,
output_vocabsize=23,
n_quadratic_filters=2,
token_representation_size=150,
concatenated_representation_size=400,
lr=0.001,
seed=123,
noise_level=0.2,
qfilter_relscale=0.1,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_cnn_model() -> tf.keras.Sequential:\n model = Sequential(\n [\n layers.Convolution1D(filters=16, kernel_size=7, input_shape=[186, 1]),\n layers.LeakyReLU(),\n layers.MaxPool1D(pool_size=2),\n layers.Convolution1D(filters=16, kernel_size=5),\n ... | [
"0.7715573",
"0.76403666",
"0.7311822",
"0.730679",
"0.7265762",
"0.7236723",
"0.7095853",
"0.7094271",
"0.70700115",
"0.70490664",
"0.7036565",
"0.7006551",
"0.69793844",
"0.6970141",
"0.6960741",
"0.69327927",
"0.6929886",
"0.68552333",
"0.6841548",
"0.6833054",
"0.6792958"... | 0.0 | -1 |
Test that local_sum_sum works when specifying dtypes manually. | def test_local_sum_sum_dtype(self):
x = tensor.tensor3(dtype='int8')
y = x.sum(axis=0, dtype='int32').sum(axis=1, dtype='int64')
backup = config.on_opt_error
config.on_opt_error = 'raise'
try:
# This compilation would fail prior to fix.
f = theano.f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_local_sum_sum_int8(self):\r\n x = tensor.tensor3(dtype='int8')\r\n y = x.sum(axis=0).sum(axis=1)\r\n backup = config.on_opt_error\r\n config.on_opt_error = 'raise'\r\n try:\r\n # This compilation would fail prior to fix.\r\n f = theano.function([x],... | [
"0.61463684",
"0.5896724",
"0.5690493",
"0.55766135",
"0.55558276",
"0.54621714",
"0.5454511",
"0.5407284",
"0.53942204",
"0.53909236",
"0.5371821",
"0.5344336",
"0.53314614",
"0.5320199",
"0.5309525",
"0.52425534",
"0.52271634",
"0.5226011",
"0.52132326",
"0.52116674",
"0.52... | 0.7638212 | 0 |
Test that random state can be transferred from one theano graph to another. | def test_random_state_transfer(self):
class Graph:
def __init__(self, seed=123):
self.rng = RandomStreams(seed)
self.y = self.rng.uniform(size=(1,))
g1 = Graph(seed=123)
f1 = function([], g1.y)
g2 = Graph(seed=987)
f2 = function... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_random_state_transfer():\r\n class Graph:\r\n def __init__(self, seed=123):\r\n self.rng = MRG_RandomStreams(seed)\r\n self.y = self.rng.uniform(size=(1,))\r\n g1 = Graph(seed=123)\r\n f1 = theano.function([], g1.y)\r\n g2 = Graph(seed=987)\r\n f2 = theano.funct... | [
"0.8296988",
"0.66706175",
"0.6555121",
"0.6376363",
"0.6263002",
"0.6216248",
"0.61831045",
"0.59938014",
"0.5945073",
"0.5942642",
"0.5853023",
"0.58236456",
"0.5820188",
"0.5778101",
"0.5765509",
"0.57612896",
"0.5747223",
"0.5728701",
"0.56993365",
"0.5694719",
"0.5672012... | 0.78081465 | 1 |
Initialize self.dtype and self.broadcastable. | def __init__(self, dtype, broadcastable, name=None, sparse_grad=False):
self.dtype = str(dtype)
if self.dtype == 'floatX':
self.dtype = config.floatX
### broadcastable is immutable, and all elements are either
### True or False
self.broadcastable = tuple(b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n\n self.check_nans = False\n self.debug_force_memmap = False\n\n # Implementations must initialise the dtype so that feature arrays can be created with correct type:\n self.dtype = None",
"def __init__(self, shape, dtype = 'd'):\n self.shape = shape\n ... | [
"0.6691246",
"0.6244691",
"0.6093311",
"0.6061196",
"0.59201276",
"0.5896555",
"0.58494765",
"0.57797277",
"0.57635546",
"0.574776",
"0.56936866",
"0.56858987",
"0.56285053",
"0.5620651",
"0.55911654",
"0.5579864",
"0.5553225",
"0.55392736",
"0.55359256",
"0.5527478",
"0.5520... | 0.69795585 | 0 |
Compare True iff other is the same kind of TensorType | def __eq__(self, other):
return type(self) == type(other) and other.dtype == self.dtype \
and other.broadcastable == self.broadcastable | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _is_equal_same_type(self, other):\n return True",
"def __eq__(self, other):\n # Note that tf doesn't override \"==\" and \"!=\", unlike numpy.\n return tf.math.equal(self._ordinals, other.ordinal())",
"def test_type_equality(self):\r\n #list of matrices\r\n myType1 = TypedListTy... | [
"0.74038434",
"0.73547333",
"0.73482436",
"0.6971886",
"0.6965925",
"0.68990403",
"0.6846567",
"0.68426377",
"0.6837819",
"0.6807335",
"0.67215765",
"0.6719531",
"0.66924244",
"0.6690574",
"0.66834575",
"0.66694206",
"0.666264",
"0.661676",
"0.6614694",
"0.6595674",
"0.658764... | 0.6752939 | 10 |
Return a `TensorVariable` of this type | def make_variable(self, name=None):
return self.Variable(self, name=name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def variable(value, dtype, name=None, broadcastable=None):\n return tf.Variable(value, dtype=dtype, name=name)",
"def as_tensor_variable(x, name=None, ndim=None):\r\n if hasattr(x, '_as_TensorVariable'):\r\n return x._as_TensorVariable() # TODO: pass name and ndim arguments\r\n\r\n if isinstance... | [
"0.7245973",
"0.7147218",
"0.7117805",
"0.6988221",
"0.68730927",
"0.68377215",
"0.6802997",
"0.6773438",
"0.677283",
"0.6751011",
"0.6723398",
"0.670249",
"0.6698477",
"0.6612007",
"0.65937215",
"0.65904784",
"0.65439755",
"0.65426916",
"0.64908344",
"0.6481408",
"0.6480322"... | 0.67485 | 11 |
Create an numpy ndarray full of 0 values. | def value_zeros(self, shape):
return numpy.zeros(shape, dtype=self.dtype) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zero(self):\n return np.zeros([self.nx])",
"def zerovec(self, X):\n return np.zeros(X.size())",
"def zeros(shape, dtype=None):\n\n return full(shape, 0, dtype)",
"def zeros_like(data):\n return _make.zeros_like(data)",
"def _zero_of_dtype(dtype):\n return np.zeros((), dtype=dtype... | [
"0.79444677",
"0.7798697",
"0.769362",
"0.75563926",
"0.7476508",
"0.7476508",
"0.74359787",
"0.7385934",
"0.7354771",
"0.73020005",
"0.7301941",
"0.7287742",
"0.728752",
"0.7280921",
"0.725638",
"0.72546124",
"0.7215893",
"0.7156399",
"0.71438265",
"0.71000654",
"0.70598257"... | 0.77086127 | 2 |
Work around the fact that dict are not hashable in python This request that all object have a sorted order that depend only on the value of the object. This is true for integer/float/string We do not verify that the objects in the dict have this property. Also, we transform values that are list into tuple as list are n... | def hash_from_dict(d):
items = d.items()
items.sort()
first_part = [k for k, v in items]
second_part = []
for k, v in items:
if isinstance(v, (tuple, list)):
second_part += [tuple(v)]
else:
second_part += [v]
tuple_items = tuple(first_part + seco... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def safe_sort_key(value):\n if isinstance(value, abc.Mapping):\n return sorted(value.items())\n return value",
"def test_sorted():\n keys = list(set([randint(0, 2^64) for i in range(0, 128)]))\n items = [(key, None) for key in keys]\n d = OrderedTreeDict(items)\n assert l... | [
"0.6799627",
"0.62867785",
"0.6220637",
"0.62015396",
"0.61451197",
"0.60771716",
"0.6038893",
"0.6019378",
"0.5973947",
"0.597112",
"0.59305894",
"0.59085554",
"0.590427",
"0.5894254",
"0.586373",
"0.58449984",
"0.583638",
"0.58117944",
"0.5767102",
"0.5760402",
"0.57336956"... | 0.5457234 | 53 |
Reorder the dimensions of this variable, optionally inserting broadcasted dimensions. | def dimshuffle(self, *pattern):
if (len(pattern) == 1) and (isinstance(pattern[0], (list, tuple))):
pattern = pattern[0]
op = theano.tensor.basic.DimShuffle(list(self.type.broadcastable),
pattern)
return op(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reorder_input_dimensions(self, train_x):\n\n source = [0, 1, 2, 3]\n destination = [3, 0, 2, 1]\n return np.moveaxis(train_x, source, destination)",
"def _fix_shape(self, value):\n for k, v in self.variables.items():\n if len(v.shape) < len(value.shape):\n ... | [
"0.6361968",
"0.5959675",
"0.57661813",
"0.5591622",
"0.557086",
"0.55616415",
"0.55025905",
"0.54942626",
"0.5426423",
"0.5411402",
"0.5396036",
"0.53858674",
"0.538425",
"0.53357863",
"0.5327013",
"0.5316156",
"0.53143245",
"0.52713865",
"0.52266103",
"0.52206105",
"0.51795... | 0.5036032 | 35 |
Returns the seed to use for running the unit tests. If an explicit seed is given, it will be used for seeding numpy's rng. If not, it will use config.unittest.rseed (its default value is 666). If config.unittest.rseed is set to "random", it will seed the rng with None, which is equivalent to seeding with a random seed.... | def fetch_seed(pseed=None):
seed = pseed or config.unittests.rseed
if seed == 'random':
seed = None
try:
if seed:
seed = int(seed)
else:
seed = None
except ValueError:
print >> sys.stderr, ('Error: config.unittests.rseed contains '
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def seed_rng(pseed=None):\r\n\r\n seed = fetch_seed(pseed)\r\n if pseed and pseed != seed:\r\n print >> sys.stderr, 'Warning: using seed given by config.unittests.rseed=%i'\\\r\n 'instead of seed %i given as parameter' % (seed, pseed)\r\n numpy.random.seed(seed)\r\n return seed",
... | [
"0.72873116",
"0.69533145",
"0.66278553",
"0.6625443",
"0.6610151",
"0.6599724",
"0.6599724",
"0.6599724",
"0.637308",
"0.6288645",
"0.62797683",
"0.6239186",
"0.62343764",
"0.6228998",
"0.6211908",
"0.61920226",
"0.6181247",
"0.6181002",
"0.61155325",
"0.61155325",
"0.608640... | 0.7010586 | 1 |
two list are equals if they contains the same type. | def __eq__(self, other):
return type(self) == type(other) and self.ttype == other.ttype | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _is_equal_same_type(self, other):\n return True",
"def __eq__(self, other):\r\n\t\treturn self._to_pylist() == other._to_pylist()",
"def test_type_equality(self):\r\n #list of matrices\r\n myType1 = TypedListType(T.TensorType(theano.config.floatX,\r\n ... | [
"0.73400205",
"0.71651375",
"0.6995785",
"0.6991699",
"0.6876938",
"0.68054384",
"0.6777985",
"0.6777563",
"0.6747115",
"0.6736411",
"0.67053473",
"0.6701681",
"0.66696674",
"0.66260165",
"0.66116804",
"0.6592811",
"0.65686053",
"0.65673095",
"0.65666604",
"0.6562704",
"0.655... | 0.67684466 | 8 |
Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix inorder arguments and keyword arguments. | def __init__(self, *args, **kwds):
if args or kwds:
super(GraspConfig, self).__init__(*args, **kwds)
# message fields cannot be None, assign default values for those that are
if self.position is None:
self.position = geometry_msgs.msg.Point()
if self.approach is None:
self.ap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, *args, **kwds):\n if args or kwds:\n super(KomodoSpeechRecCommand, self).__init__(*args, **kwds)\n #message fields cannot be None, assign default values for those that are\n if self.header is None:\n self.header = std_msgs.msg.Header()\n if self.cmd is None:\n ... | [
"0.77937967",
"0.77195275",
"0.77195275",
"0.7685702",
"0.762502",
"0.7562939",
"0.74384665",
"0.7416083",
"0.73515767",
"0.73078126",
"0.7280228",
"0.723719",
"0.72265446",
"0.72230625",
"0.72230625",
"0.7218876",
"0.721051",
"0.721051",
"0.721051",
"0.721051",
"0.721051",
... | 0.6603083 | 87 |
Create an empty queue for testing purposes. | def empty_queue():
return Queue() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_empty_queue():\n return Queue(0, None, None)",
"def test_new_queue_is_empty(self):\n queue = Queue_()\n self.assertTrue(queue.empty())\n self.assertEqual(queue.size(), 0)",
"def test_can_instantiate_empty_queue(empty_queue):\n assert isinstance(empty_queue, Queue)",
"def t... | [
"0.87573",
"0.8339417",
"0.7874286",
"0.7688589",
"0.7597247",
"0.75266016",
"0.7403714",
"0.739848",
"0.7338653",
"0.7266403",
"0.72027254",
"0.7040077",
"0.70273125",
"0.69999725",
"0.6998538",
"0.6993233",
"0.6988335",
"0.6949918",
"0.69351053",
"0.6924336",
"0.6898062",
... | 0.8433024 | 2 |
Create a small queue for testing purposes. | def small_queue():
que = Queue()
que.enqueue(1)
que.enqueue(2)
que.enqueue(3)
que.enqueue(4)
que.enqueue(5)
return que | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def small_queue():\n queue = Queue()\n queue.enqueue(1)\n queue.enqueue(2)\n queue.enqueue(3)\n queue.enqueue(4)\n return queue",
"def new_queue() -> Queue:\n return multiprocessing.Queue()",
"def test_enqueue(self):\n queue = Queue()\n self.assertEqual(queue.size(), 0)\n queue.en... | [
"0.79768986",
"0.77032524",
"0.75985634",
"0.752147",
"0.7439148",
"0.74139786",
"0.7395112",
"0.7370439",
"0.7321107",
"0.7250977",
"0.72287565",
"0.71923524",
"0.7159232",
"0.71134305",
"0.71012497",
"0.70916927",
"0.70916927",
"0.7087515",
"0.70676666",
"0.7061669",
"0.705... | 0.7908397 | 1 |
Create a large queue for testing purposes. | def large_queue():
que = Queue()
for num in range(1, 11):
que.enqueue(num)
return que | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def small_queue():\n queue = Queue()\n queue.enqueue(1)\n queue.enqueue(2)\n queue.enqueue(3)\n queue.enqueue(4)\n return queue",
"def new_queue() -> Queue:\n return multiprocessing.Queue()",
"def small_queue():\n que = Queue()\n que.enqueue(1)\n que.enqueue(2)\n que.enqueue(3)... | [
"0.7577758",
"0.7361566",
"0.7332556",
"0.70039433",
"0.696739",
"0.6917268",
"0.6852372",
"0.6786425",
"0.6765976",
"0.6705411",
"0.66690004",
"0.6609439",
"0.6601764",
"0.6599603",
"0.65972775",
"0.65903175",
"0.64414555",
"0.6417862",
"0.6417593",
"0.6411662",
"0.63749725"... | 0.81138176 | 0 |
Returns API version information for the HMC. This operation does not require authentication. | def version_info(self):
if self._api_version is None:
self.query_api_version()
return self._api_version['api-major-version'],\
self._api_version['api-minor-version'] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_version_info(self):\n return self._jadeRpc('get_version_info')",
"def get_version(self):\n return self.http_call(\"get\", url=f\"{self.base_url}/version\").json()",
"def GetVersion(self):\n return self._SendRequest(HTTP_GET, \"/version\", None, None)",
"def get_version(self):\n ... | [
"0.71426904",
"0.7103691",
"0.7066672",
"0.70422304",
"0.6752333",
"0.67023045",
"0.6687338",
"0.6677658",
"0.6673926",
"0.6630329",
"0.6605182",
"0.65999",
"0.6586613",
"0.6561239",
"0.6549753",
"0.6548861",
"0.6548792",
"0.65484",
"0.65446365",
"0.64685124",
"0.6460169",
... | 0.7195321 | 0 |
The Query API Version operation returns information about the level of Web Services API supported by the HMC. This operation does not require authentication. | def query_api_version(self):
version_resp = self._session.get('/api/version',
logon_required=False)
self._api_version = version_resp
return self._api_version | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def api(self):\n res = self.client.call('/', 'GET', data='')\n self.logger.debug('Get openstack identity api versions: %s' % truncate(res))\n return res[0]",
"def get_api_version(self):\n return self.connector.request('GET', '/app/webapiVersion')",
"def GetVersion(self):\n return... | [
"0.6596225",
"0.65604097",
"0.6407041",
"0.64068544",
"0.63328904",
"0.62285703",
"0.6139431",
"0.6117221",
"0.6022599",
"0.6017963",
"0.59707785",
"0.59473974",
"0.5943966",
"0.5928972",
"0.5919964",
"0.590581",
"0.58838516",
"0.5877067",
"0.587059",
"0.587059",
"0.587059",
... | 0.7240701 | 0 |
Adds the deployment to the list of deployment definitions. Replaces the deployment with the same unique id, if it already exists. | def add_deployment_definition(deployments: DeploymentDefinitions,
deployment: Union[Nodes,
JupyterDeployment,
DaskDeployment]):
deployment_definition = get_deployment_definition(deployment=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_deployment(self, dep):\n res = self.client.Management_API.Create_Deployment(\n Authorization=\"foo\", deployment=dep\n ).result()\n adapter = res[1]\n loc = adapter.headers.get(\"Location\", None)\n depid = os.path.basename(loc)\n\n self.log.debug(\"adde... | [
"0.6803931",
"0.587305",
"0.567546",
"0.5565699",
"0.54224426",
"0.53950423",
"0.53379524",
"0.53017193",
"0.5261198",
"0.52506447",
"0.5198998",
"0.5140009",
"0.51324993",
"0.5127871",
"0.50441825",
"0.50181925",
"0.48927578",
"0.488108",
"0.48788393",
"0.48312083",
"0.47680... | 0.7387434 | 0 |
Calculate the great circle distance between two points on the earth (specified in decimal degrees) | def haversine(lon1, lat1, lon2, lat2):
# convert decimal degrees to radians
lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2])
# haversine formula
dlon = lon2 - lon1
dlat = lat2 - lat1
a = sin(dlat/2)**2 + cos(lat1) * cos(lat2) * sin(dlon/2)**2
c = 2 * asin(sqrt(a))
km = 6367 * c
return km | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def great_circle(lat_1, long_1, lat_2, long_2):\n long_1 = m.radians(long_1)\n lat_1 = m.radians(lat_1)\n long_2 = m.radians(long_2)\n lat_2 = m.radians(lat_2)\n\n d = 2 * 6367.45 * m.asin(\n m.sqrt(haversine(lat_2 - lat_1)\n + m.cos(lat_1)*m.cos(lat_2) *\n haversine(long... | [
"0.8145448",
"0.78638905",
"0.76325417",
"0.760538",
"0.75962216",
"0.7595357",
"0.7593555",
"0.75710064",
"0.75635517",
"0.7555634",
"0.7529043",
"0.7516842",
"0.74934894",
"0.7466314",
"0.74512833",
"0.7433337",
"0.7390745",
"0.73570377",
"0.7348286",
"0.7330498",
"0.732846... | 0.0 | -1 |
Yield successive nsized chunks from l. | def chunks(self, l, n):
for i in xrange(0, len(l), n):
yield l[i:i+n] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _chunk(self, l, n):\n for i in range(0, len(l) + 1, n):\n yield l[i:i + n]",
"def chunks(self, l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def __chunks(l, n):\n for i in range(0, len(l), n):\n yield l[i:i + n]",
"def get_chunks(self, ... | [
"0.8038813",
"0.79248375",
"0.7923423",
"0.7885103",
"0.7815877",
"0.77655786",
"0.77556044",
"0.77441615",
"0.7731815",
"0.77288336",
"0.772473",
"0.77028215",
"0.76889825",
"0.76889825",
"0.7664208",
"0.76570904",
"0.7655856",
"0.7655856",
"0.76458347",
"0.76458347",
"0.764... | 0.78773195 | 4 |
Function finds indexes of all phash pairs and label group pairs (for train set only) in the original DataFrame. | def check_pairs(reference_df: pd.DataFrame, check_labels=False) -> list:
print('Number of candidate pairs:', len(pairs))
# Indexes of add pairs with identical phash
all_pairs = set()
groups = reference_df.groupby(by='image_phash')
# Numeric index of rows in train set as a temporary column
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def groupByLabel( y ):\n index = []\n for i in np.unique(y): # pour toutes les classes\n ind, = np.where(y==i)\n index.append(ind)\n \n return index",
"def build_index_groups(train):\n nz_row, nz_col = train.nonzero()\n nz_train = list(zip(nz_row, nz_col))\n\n grouped_nz_tr... | [
"0.6275427",
"0.6256384",
"0.6043379",
"0.5933521",
"0.5885691",
"0.5869272",
"0.58329034",
"0.5811262",
"0.57328355",
"0.5697685",
"0.5685566",
"0.5670118",
"0.5657511",
"0.5615625",
"0.560743",
"0.5588713",
"0.55667704",
"0.5559166",
"0.5530719",
"0.54724497",
"0.5460302",
... | 0.66783994 | 0 |
Function returns a Series of absolute paths to images given file names and directory name. | def abs_path(file_name: str, directory: str) -> str:
return os.path.join(directory, file_name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_all_image_paths(self):\n image_paths, image_labels = [], []\n for directory_name, subdirectory_list, file_list in os.walk(self.root_directory):\n for file_name in file_list:\n if file_name.endswith(('.jpg',)):\n image_paths.append(os.path.join(dire... | [
"0.73180366",
"0.7181579",
"0.7130902",
"0.7032608",
"0.6974819",
"0.69321495",
"0.6930884",
"0.6895655",
"0.68754154",
"0.67568207",
"0.67558765",
"0.67330647",
"0.67161894",
"0.66617095",
"0.6652267",
"0.6595981",
"0.6595605",
"0.6591014",
"0.65768856",
"0.6572403",
"0.6538... | 0.0 | -1 |
Get the list of all projects for the user. | def get_project_list(token):
session = requests.Session()
session.headers.update({'Authorization': f'Token {token}'})
url = get_project_list_url()
r = session.get(url=url)
return r | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_projects():\n if current_user.get_id() is None:\n return\n with database.engine.begin() as connection:\n result = connection.execute(select(\n [models.projects.c.project_id, models.projects.c.name, models.projects.c.path, models.projects.c.creation_date, models.projects.c.use... | [
"0.83008605",
"0.8084061",
"0.79259026",
"0.7920916",
"0.7890392",
"0.78604746",
"0.7716244",
"0.77162427",
"0.7659709",
"0.74965405",
"0.7493568",
"0.7483736",
"0.7466889",
"0.7464289",
"0.74602276",
"0.7454886",
"0.7446021",
"0.7443285",
"0.7399906",
"0.73974663",
"0.738200... | 0.674059 | 67 |
Add an annotation to an existing document. | def post_document_annotation(
document_id: int,
start_offset: int,
end_offset: int,
label_id: int,
template_id: int,
accuracy: float,
revised: bool = False,
is_correct: bool = False,
section=None,
define_section=True,
session=konfuzio_session(),
):
url = post_project_api_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_annotation(self, annotation):\n self.annotations.append(annotation)",
"def add_annotation_comment(self, doc, comment):\n if len(doc.annotations) != 0:\n if not self.annotation_comment_set:\n self.annotation_comment_set = True\n if validations.validat... | [
"0.7954846",
"0.70356303",
"0.700891",
"0.6877154",
"0.68559724",
"0.68463993",
"0.6802454",
"0.6749095",
"0.67476803",
"0.6733095",
"0.6721432",
"0.65924305",
"0.6516174",
"0.6497855",
"0.64972985",
"0.6455094",
"0.6181597",
"0.6170012",
"0.61687124",
"0.6167884",
"0.6154262... | 0.6201527 | 16 |
Return true if the string is a valid URL. | def is_url(url: str) -> bool:
logger.info(url)
result = urlparse(url)
return all([result.scheme, result.netloc]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_url(string):\n try:\n urlparse(string)\n return True\n except:\n return False",
"def _is_url(string):\n return \"http\" in string",
"def IsValidURL(s):\n return RE_COMPLEX_URL.match(s)",
"def _is_url(s: str) -> bool:\n\n return urlparse(s).netloc != \"\"",
"def ISUR... | [
"0.8634313",
"0.8434771",
"0.8407816",
"0.8346718",
"0.82055235",
"0.8150725",
"0.81486374",
"0.80892557",
"0.80837756",
"0.8076862",
"0.8008439",
"0.79719126",
"0.7966846",
"0.79571146",
"0.7950598",
"0.79222065",
"0.7919357",
"0.79155076",
"0.78849804",
"0.7880674",
"0.7871... | 0.7606503 | 34 |
GET /auth/confirm Confirm the valid email address. The token must be valid. | def confirm():
if g.session.user.email_confirmed:
return redirect(url_for('index.index'))
token = request.args.get('token')
if token:
try:
user: User = db.session.query(User) \
.filter(User.confirmation_token == token).one()
user.email_confirmed = Tr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def confirm_registration_view(request):\n user_email_token = request.matchdict['email_confirm']\n non_active_user = User.get_one(request, url_token=user_email_token)\n if non_active_user is None:\n return {\"msg\": \"Error404 HTTPNotFound\"}\n else:\n non_active_user.status_id = UserStatu... | [
"0.7421485",
"0.68410134",
"0.6776162",
"0.66560555",
"0.66480505",
"0.6647147",
"0.6637343",
"0.65662557",
"0.6564408",
"0.65617126",
"0.6538115",
"0.6529683",
"0.65090716",
"0.64977205",
"0.6481533",
"0.646616",
"0.6378266",
"0.63479435",
"0.6342298",
"0.6340718",
"0.632592... | 0.82573104 | 0 |
Collect adverbial and other modifiers of an action. For right now we only handle a subset of spatial modifiers which are realized as prepositions. | def _collect_action_modifiers(
self, action: Action[OntologyNode, SituationObject]
) -> Iterable[Tuple[DependencyRole, DependencyTreeToken]]:
modifiers: List[Tuple[DependencyRole, DependencyTreeToken]] = []
if USE_ADVERBIAL_PATH_MODIFIER in self.situation.syntax_hints:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_action_additional_info(action_dct, verb_dct, action, has_direct_object, has_indirect_object, init_index_verb, final_index_verb):\n print(\"ACTION\")\n print(action)\n has_replacements = False if action['What is the action?']['initial_value'] == \\\n action['What is th... | [
"0.60381097",
"0.6002605",
"0.59271497",
"0.56747305",
"0.5487913",
"0.5471016",
"0.54059595",
"0.5349505",
"0.53179353",
"0.5193219",
"0.51591957",
"0.51346534",
"0.512393",
"0.51050705",
"0.50978065",
"0.50752133",
"0.504041",
"0.5012392",
"0.50079894",
"0.50059426",
"0.499... | 0.78336 | 0 |
Set the log level | def _set_logger(self, level):
log.basicConfig(
format='[%(asctime)s %(levelname)s]: %(message)s',
level=log._nameToLevel.get(level.upper(), log.DEBUG)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_log_level(self, level):\n if level == 'info':\n level = logging.INFO\n if level == 'debug':\n level = logging.DEBUG\n if level == 'error':\n level = logging.ERROR\n self._log.setLevel(level)",
"def setLogLevel(self,value):\n self.PDFreac... | [
"0.8334709",
"0.83231807",
"0.8297089",
"0.8282888",
"0.8232172",
"0.81102514",
"0.803674",
"0.7977816",
"0.7936401",
"0.7871474",
"0.7869579",
"0.77836066",
"0.7760196",
"0.775072",
"0.7721698",
"0.7685696",
"0.7676986",
"0.7658721",
"0.7574674",
"0.75149375",
"0.74975646",
... | 0.7507586 | 20 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.