You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LEAP binary representation uses a numpy binary vector. (See, binary_rep.initializers.random_bernoulli_vector()). The string representation returns a vector of booleans instead of the expected binary string. E.g.,
n = np.random.rand(*shape) < 0.5
n
Out[6]: array([False, False, False, False])
That should be [0,0,0,0].
You can cast that to a vector of integers:
n.astype(int)
Out[7]: array([0, 0, 0, 0])
But then you presumably lose the compressed and optimized binary representation used by numpy.
So, ideally we'd like to keep that internal optimized binary representation while also printing ones and zeroes.
The text was updated successfully, but these errors were encountered:
@lukepmccombs has a solution that involves extending his context manager in probe.py that entails use of tailoring a numpy string format for binary genomes.
LEAP binary representation uses a numpy binary vector. (See, binary_rep.initializers.random_bernoulli_vector()). The string representation returns a vector of booleans instead of the expected binary string. E.g.,
n = np.random.rand(*shape) < 0.5
n
Out[6]: array([False, False, False, False])
That should be [0,0,0,0].
You can cast that to a vector of integers:
n.astype(int)
Out[7]: array([0, 0, 0, 0])
But then you presumably lose the compressed and optimized binary representation used by numpy.
So, ideally we'd like to keep that internal optimized binary representation while also printing ones and zeroes.
The text was updated successfully, but these errors were encountered: