Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/aspire/classification/legacy_implementations.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def bispec_2drot_large(coef, freqs, eigval, alpha, sample_n, seed=None):
# This became a problem with very noisy images...
p = np.power(eigval, alpha)
mask = np.where(p, p, -1) # taking the log in the next step will yield a 0
m = np.exp(o1 * np.log(p, where=(mask > 0)))
m = np.exp(o1 * np.log(p, where=(mask > 0), out=None))
p_m = m / m.sum()
x = random(size=len(m), seed=seed)
m_id = np.where(x < sample_n * p_m)[0]
Expand Down
2 changes: 1 addition & 1 deletion src/aspire/utils/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def fix_signs(u):
# Create array of sign corrections
signs = np.take_along_axis(u, np.expand_dims(index_array, axis=0), axis=0).squeeze()
_abs = np.absolute(signs)
signs = np.divide(_abs, signs, where=_abs != 0)
np.divide(_abs, signs, out=signs, where=_abs != 0)

# Now we only care about the sign +1/-1.
# The following corrects for any numerical division noise,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def testFixSigns(self):
"""

# Create simple array
x = np.arange(25).reshape(5, 5)
x = np.arange(25, dtype=np.float32).reshape(5, 5)
# Set diagonal elements = -1
x[np.diag_indices_from(x)] *= -1
# Negate largest elem (last row) of first col
Expand Down
Loading