Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boolean representation outputs boolean values instead of binary strings. #321

Open
markcoletti opened this issue Feb 22, 2024 · 1 comment
Assignees

Comments

@markcoletti
Copy link
Collaborator

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.

@markcoletti markcoletti self-assigned this Feb 22, 2024
@markcoletti
Copy link
Collaborator Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant