Skip to content

Commit

Permalink
make the words match the code
Browse files Browse the repository at this point in the history
  • Loading branch information
mcabbott committed Feb 21, 2022
1 parent 312cad5 commit 875043c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,10 @@ randn32(dims...) = Base.randn(Float32, dims...)
Return a bias parameter for a layer, based on the value given
to the constructor's keyword `bias=bias`.
* `bias == true` creates a zero vector, of the same type as weights.
* `bias == true` creates a trainable array of the given size, of the same type as `weights`, initialised to zero.
* `bias == false` returns `false` now, which is understood by AD to be non-differentiable.
* `bias::AbstractArray` uses the array provided, provided it has the correct size and eltype. If the type is wrong, it will be converted.
* `bias::AbstractArray` uses the array provided, provided it has the correct size.
It does not at present correct the `eltype` to match that of `weights`.
"""
function create_bias(weights::AbstractArray, bias::Bool, dims::Integer...)
bias ? fill!(similar(weights, dims...), 0) : false
Expand Down

0 comments on commit 875043c

Please sign in to comment.