Skip to content

Commit 28c90ab

Browse files
committed
Fix CrossCor's docstring
1 parent b6730a8 commit 28c90ab

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

docs/src/models/layers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ DepthwiseConv
2424
ConvTranspose
2525
ConvTranspose(weight::AbstractArray)
2626
CrossCor
27+
CrossCor(weight::AbstractArray)
2728
SamePad
2829
Flux.flatten
2930
```

src/layers/conv.jl

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,8 @@ end
381381

382382
"""
383383
CrossCor(filter, in => out, σ=identity; stride=1, pad=0, dilation=1, [bias, init])
384-
CrossCor(weight::AbstractArray, [bias, activation; stride, pad, dilation])
385384
386-
Standard cross convolutional layer. `filter` is a tuple of integers
385+
Standard cross correlation layer. `filter` is a tuple of integers
387386
specifying the size of the convolutional kernel;
388387
`in` and `out` specify the number of input and output channels.
389388
@@ -420,6 +419,28 @@ struct CrossCor{N,M,F,A,V}
420419
dilation::NTuple{N,Int}
421420
end
422421

422+
"""
423+
CrossCor(weight::AbstractArray, [bias, activation; stride, pad, dilation])
424+
425+
Constructs a CrossCor layer with the given weight and bias.
426+
Accepts the same keywords (and has the same defaults) as the `CrossCor((5,5), 3 => 6, relu)` method.
427+
428+
# Examples
429+
```jldoctest
430+
julia> weight = rand(3, 4, 5);
431+
432+
julia> bias = zeros(5);
433+
434+
julia> lay = CrossCor(weight, bias, relu)
435+
CrossCor((3,), 4 => 5, relu) # 65 parameters
436+
437+
julia> lay(randn(100, 4, 64)) |> size
438+
(98, 5, 64)
439+
440+
julia> Flux.params(lay) |> length
441+
2
442+
```
443+
"""
423444
function CrossCor(w::AbstractArray{T,N}, bias = true, σ = identity;
424445
stride = 1, pad = 0, dilation = 1) where {T,N}
425446
stride = expand(Val(N-2), stride)

0 commit comments

Comments
 (0)