Skip to content

The Hypercube space for binary vectors and labeled unweighted graphs - #141

Merged
vabor112 merged 14 commits into
mainfrom
slava/binary_graph_space
Aug 15, 2024
Merged

The Hypercube space for binary vectors and labeled unweighted graphs#141
vabor112 merged 14 commits into
mainfrom
slava/binary_graph_space

Conversation

@vabor112

@vabor112 vabor112 commented Aug 6, 2024

Copy link
Copy Markdown
Member

This PR implements a new space: the hypercube graph space $\{0,1\}^d$ of binary vectors.

It includes a new space (HypercubeGraph), the respective notebook HypercubeGraph.ipynb, a theory page docs/theory/hypercube_graph.rst, and tests.

@vabor112 vabor112 changed the title Spaces for binary vectors, labeled unweighted graphs and unlabeled unweighted graphs The Hypercube space for binary vectors and labeled unweighted graphs Aug 9, 2024
@vabor112
vabor112 marked this pull request as ready for review August 11, 2024 12:58

@stoprightthere stoprightthere left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job! I have left some comments about the code.

Comment thread geometric_kernels/kernels/matern_kernel.py Outdated
Comment thread geometric_kernels/spaces/hypercube.py
Comment thread geometric_kernels/spaces/hypercube.py Outdated
The GeometricKernels space representing the d-dimensional hypercube graph
$C^d = \{0, 1\}^d$, the combinatorial space of binary vectors of length $d$.

The elements of this space are represented by d-dimensional boolean vectors.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a particular reason for using boolean vectors, as opposed to, say, integer vectors?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. To save memory. In the implementation of my dreams, they should be actual bit-arrays. This is much harder than what I did here though, especially if the implementation should be backend-independent.
  2. Interpretation. This is a space of binary vectors. Binary ≈ Boolean.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bool requires as much memory as int, so this argument doesn't quite hold. And everyone knows that binary means zeros and ones :)

Comment thread geometric_kernels/utils/special_functions.py Outdated
Comment thread geometric_kernels/utils/utils.py Outdated
Comment thread geometric_kernels/utils/utils.py Outdated
@vabor112

Copy link
Copy Markdown
Member Author

Revised.

@stoprightthere stoprightthere left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vabor112
vabor112 merged commit 1ef797b into main Aug 15, 2024
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

Successfully merging this pull request may close these issues.

2 participants