Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit f46927a

Browse files
Format .jl files (#110)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 22024fb commit f46927a

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/components/explorers/batch_explorer.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ Apply inner explorer to each column of `values`.
1616
"""
1717
(x::BatchExplorer)(values::AbstractMatrix) = [x.explorer(v) for v in eachcol(values)]
1818

19-
(x::BatchExplorer)(values::AbstractMatrix, mask::AbstractMatrix) = [x.explorer(v,m) for (v,m) in zip(eachcol(values), eachcol(mask))]
19+
(x::BatchExplorer)(values::AbstractMatrix, mask::AbstractMatrix) =
20+
[x.explorer(v, m) for (v, m) in zip(eachcol(values), eachcol(mask))]
2021

2122
(x::BatchExplorer)(v::AbstractVector) = x.explorer(v)
22-
(x::BatchExplorer)(v::AbstractVector, m::AbstractVector) = x.explorer(v,m)
23+
(x::BatchExplorer)(v::AbstractVector, m::AbstractVector) = x.explorer(v, m)
2324

2425
Flux.testmode!(x::BatchExplorer, mode = true) = testmode!(x.explorer, mode)

src/components/explorers/gumbel_softmax_explorer.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ function (p::GumbelSoftmaxExplorer)(v::AbstractVector{T}) where {T}
1515
argmax(logits .- log.(-log.(u)))
1616
end
1717

18-
function (p::GumbelSoftmaxExplorer)(v::AbstractVector{T}, mask::AbstractVector{Bool}) where {T}
18+
function (p::GumbelSoftmaxExplorer)(
19+
v::AbstractVector{T},
20+
mask::AbstractVector{Bool},
21+
) where {T}
1922
v[.!mask] .= typemin(T)
2023
p(v)
2124
end

src/components/explorers/weighted_softmax_explorer.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ struct WeightedSoftmaxExplorer{R<:AbstractRNG} <: AbstractExplorer
1313
rng::R
1414
end
1515

16-
function WeightedSoftmaxExplorer(;rng = Random.GLOBAL_RNG)
16+
function WeightedSoftmaxExplorer(; rng = Random.GLOBAL_RNG)
1717
WeightedSoftmaxExplorer(rng)
1818
end
1919

2020
(s::WeightedSoftmaxExplorer)(values::AbstractVector{T}) where {T} =
2121
sample(s.rng, Weights(softmax(values), one(T)))
2222

23-
function (s::WeightedSoftmaxExplorer)(values::AbstractVector{T}, mask) where T
23+
function (s::WeightedSoftmaxExplorer)(values::AbstractVector{T}, mask) where {T}
2424
values[.!mask] .= typemin(T)
2525
s(values)
2626
end
27-

0 commit comments

Comments
 (0)