Conversation
| # Alternatively, one can create a hypervector directly from a `Vector{T}` where `{T}` is an | ||
| # appropiate data type, e.g. booleans for BipolarHV: | ||
|
|
||
| BipolarHV(rand([-1, 1], 8)) |
There was a problem hiding this comment.
Not a big fan of this. Bipolar should be [-1, 1]. The user should not be aware that this is stored as a bitvector...
There was a problem hiding this comment.
that makes sense, I got carried away refactoring things
| h₁ = BipolarHV(8) | ||
| h₂ = BipolarHV(8) | ||
| h₃ = BipolarHV(8); | ||
| h₁ = BipolarHV(; dims = 8) |
There was a problem hiding this comment.
Does dims imply that it should work for arbitrary shapes?
There was a problem hiding this comment.
I would say no, but based on the common meaning of dims in julia it could imply that. I'll change it to D as we had it before
| # Querying memory to search for dog's sound: | ||
|
|
||
| findmax(hv -> similarity(memory * dog_hv, hv), sounds) | ||
| findmax(hv -> similarity(memory * H_dog, hv), H_sounds) |
There was a problem hiding this comment.
There is a method for this in inferences.jl
There was a problem hiding this comment.
true, forgot about it. adding to list of changes
| # --------- | ||
|
|
||
| # ------------------------------------------------------------------------------------ BipolarHV | ||
| struct BipolarHV <: AbstractHV{Int} |
There was a problem hiding this comment.
Make sure there is a method that inputs Int vectors and uses the sign
| end | ||
|
|
||
| BipolarHV(n::Integer = 10_000) = BipolarHV(bitrand(n)) | ||
| BipolarHV(v::AbstractVector) = BipolarHV(v .> 0) |
There was a problem hiding this comment.
Whoops, is here! It might be good to do rand(Bool) when v[i] == 0 to avoid bias
|
Looks good! Maybe we can also change |
Maybe make |
Fine, let's just keep using approx |
|
@MichielStock review this and if it looks good to you, we merge it and then merge #37 |
|
Sorry for the long wait, looks perfect. You can merge! |
Closes #39
This is a breaking change