a1890b56835ef626b1a32edcaf28c1e2b10baa48,dit/algorithms/maxentropyfw.py,,isolate_zeros,#,67
Before Change
zero_elements += bvec
A = []
b = []
zero = []
for i, is_zero in enumerate(zero_elements):
if is_zero:
eq = np.zeros(n_elements, dtype=int)
eq[i] = 1
A.append(eq)
b.append(0)
zero.append(i)
if A:
A = np.asarray(A)
b = np.asarray(b)
else:
A = None
b = None
zeroset = set(zero)
nonzero = [i for i in range(n_elements) if i not in zeroset]
variables = Bunch(nonzero=nonzero, zero=zero)
return A, b, variables
def initial_point(dist, k, A=None, b=None, isolated=None, **kwargs):
After Change
xopt[np.abs(xopt) < tol] = 0
xopt /= xopt.sum()
// Do not build the full vector since this is input to the reduced
// optim ization problem.
//xx = np.zeros(len(dist.pmf))
//xx[variables.nonzero] = xopt
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 9
Instances Project Name: dit/dit
Commit Name: a1890b56835ef626b1a32edcaf28c1e2b10baa48
Time: 2015-03-19
Author: chebee7i@gmail.com
File Name: dit/algorithms/maxentropyfw.py
Class Name:
Method Name: isolate_zeros
Project Name: dit/dit
Commit Name: a1890b56835ef626b1a32edcaf28c1e2b10baa48
Time: 2015-03-19
Author: chebee7i@gmail.com
File Name: dit/algorithms/maxentropyfw.py
Class Name:
Method Name: isolate_zeros
Project Name: jazzband/django-debug-toolbar
Commit Name: e403821323d529980407c05da77409c7e1c5c2a0
Time: 2008-09-08
Author: rob@cogit8.org
File Name: debug_toolbar/panels/headers.py
Class Name: HeaderDebugPanel
Method Name: content
Project Name: jazzband/django-debug-toolbar
Commit Name: d85509edab8290666d056ba5f0a9423feceb64d5
Time: 2008-09-07
Author: rob@cogit8.org
File Name: debug_toolbar/panels/sql.py
Class Name: SQLDebugPanel
Method Name: content
Project Name: commonsense/conceptnet5
Commit Name: e33d1ba9150a3084947ae000f12a9b6f2f644648
Time: 2017-02-23
Author: joanna.teresa.duda@gmail.com
File Name: conceptnet5/vectors/evaluation/wordsim.py
Class Name:
Method Name: evaluate_semeval_monolingual