-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from FluxML/darsnack/register
- Loading branch information
Showing
9 changed files
with
139 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
steps: | ||
- label: "GPU integration with julia v1.6" | ||
plugins: | ||
- JuliaCI/julia#v1: | ||
# Drop default "registries" directory, so it is not persisted from execution to execution | ||
# Taken from https://github.com/JuliaLang/julia/blob/v1.7.2/.buildkite/pipelines/main/platforms/package_linux.yml#L11-L12 | ||
persist_depot_dirs: packages,artifacts,compiled | ||
version: "1.6" | ||
- JuliaCI/julia-test#v1: ~ | ||
agents: | ||
queue: "juliagpu" | ||
cuda: "*" | ||
timeout_in_minutes: 60 | ||
|
||
- label: "GPU integration with julia v1" | ||
plugins: | ||
- JuliaCI/julia#v1: | ||
version: "1" | ||
- JuliaCI/julia-test#v1: ~ | ||
- JuliaCI/julia-coverage#v1: | ||
codecov: true | ||
agents: | ||
queue: "juliagpu" | ||
cuda: "*" | ||
env: | ||
JULIA_CUDA_USE_BINARYBUILDER: "true" | ||
timeout_in_minutes: 60 | ||
|
||
# - label: "GPU nightly" | ||
# plugins: | ||
# - JuliaCI/julia#v1: | ||
# version: "nightly" | ||
# - JuliaCI/julia-test#v1: ~ | ||
# agents: | ||
# queue: "juliagpu" | ||
# cuda: "*" | ||
# timeout_in_minutes: 60 | ||
|
||
env: | ||
SECRET_CODECOV_TOKEN: "fAV/xwuaV0l5oaIYSAXRQIor8h7yHdlrpLUZFwNVnchn7rDk9UZoz0oORG9vlKLc1GK2HhaPRAy+fTkJ3GM/8Y0phHh3ANK8f5UsGm2DUTNsnf6u9izgnwnoRTcsWu+vSO0fyYrxBvBCoJwljL+yZbDFz3oE16DP7HPIzxfQagm+o/kMEszVuoUXhuLXXH0LxT6pXl214qjqs04HfMRmKIIiup48NB6fBLdhGlQz64MdMNHBfgDa/fafB7eNvn0X6pEOxysoy6bDQLUhKelOXgcDx1UsTo34Yiqr+QeJPAeKcO//PWurwQhPoUoHfLad2da9DN4uQk4YQLqAlcIuAA==;U2FsdGVkX1+mRXF2c9soCXT7DYymY3msM+vrpaifiTp8xA+gMpbQ0G63WY3tJ+6V/fJcVnxYoKZVXbjcg8fl4Q==" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[deps] | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
|
||
[compat] | ||
Documenter = "0.27" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Documenter, OneHotArrays | ||
|
||
DocMeta.setdocmeta!(OneHotArrays, :DocTestSetup, :(using OneHotArrays); recursive = true) | ||
makedocs(sitename = "OneHotArrays", doctest = false, | ||
pages = ["Overview" => "index.md", | ||
"Reference" => "reference.md"]) | ||
|
||
deploydocs(repo = "github.com/FluxML/OneHotArrays.jl.git", | ||
target = "build", | ||
push_preview = true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# OneHotArrays.jl | ||
|
||
[![CI](https://github.com/FluxML/OneHotArrays.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/FluxML/OneHotArrays.jl/actions/workflows/CI.yml) | ||
|
||
Memory efficient one-hot array encodings (primarily for use in machine-learning contexts like Flux.jl). | ||
|
||
## Usage | ||
|
||
One-hot arrays are boolean arrays where only a single element in the first dimension is `true` (i.e. "hot"). OneHotArrays.jl stores such arrays efficiently by encoding a N-dimensional array of booleans as a (N - 1)-dimensional array of integers. For example, the one-hot vector below only uses a single `UInt32` for storage. | ||
|
||
```julia | ||
julia> β = onehot(:b, (:a, :b, :c)) | ||
3-element OneHotVector(::UInt32) with eltype Bool: | ||
⋅ | ||
1 | ||
⋅ | ||
``` | ||
|
||
As seen above, the one-hot encoding can be useful for representing labeled data. The label `:b` is encoded into a 3-element vector where the "hot" element indicates the label from the set `(:a, :b, :c)`. | ||
|
||
We can also encode a batch of one-hot vectors or reverse the encoding. | ||
|
||
```julia | ||
julia> oh = onehotbatch("abracadabra", 'a':'e', 'e') | ||
5×11 OneHotMatrix(::Vector{UInt32}) with eltype Bool: | ||
1 ⋅ ⋅ 1 ⋅ 1 ⋅ 1 ⋅ ⋅ 1 | ||
⋅ 1 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 1 ⋅ ⋅ | ||
⋅ ⋅ ⋅ ⋅ 1 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ | ||
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 1 ⋅ ⋅ ⋅ ⋅ | ||
⋅ ⋅ 1 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 1 ⋅ | ||
|
||
julia> Flux.onecold(β, (:a, :b, :c)) | ||
:b | ||
|
||
julia> Flux.onecold([0.3, 0.2, 0.5], (:a, :b, :c)) | ||
:c | ||
``` | ||
|
||
In addition to functions for encoding and decoding data as one-hot, this package provides numerous "fast-paths" for linear algebraic operations with one-hot arrays. For example, multiplying by a matrix by a one-hot vector triggers an indexing operation instead of a matrix multiplication. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Reference | ||
|
||
```@autodocs | ||
Modules = [OneHotArrays] | ||
Order = [:function, :type] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d44a239
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
d44a239
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/58049
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
d44a239
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
d44a239
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/64647
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: