Skip to content

Commit 318e1a5

Browse files
committed
Support ConvTranspose and CrossCor layers
1 parent b8a203d commit 318e1a5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/flux_types.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Layer types
22
"""Union type for convolutional layers."""
3-
const ConvLayer = Union{Conv} # TODO: DepthwiseConv, ConvTranspose, CrossCor
3+
const ConvLayer = Union{Conv, ConvTranspose, CrossCor}
44

55
"""Union type for dropout layers."""
66
const DropoutLayer = Union{Dropout,typeof(Flux.dropout),AlphaDropout}

src/flux_utils.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ In case the layer is unknown or no activation function is found, `nothing` is re
66
"""
77
activation(l::Dense) = l.σ
88
activation(l::Conv) = l.σ
9+
activation(l::ConvTranspose) = l.σ
10+
activation(l::CrossCor) = l.σ
911
activation(l::BatchNorm) = l.λ
1012
activation(layer) = nothing # default for all other layer types
1113

1214
function has_activation(layer)
1315
hasproperty(layer, ) && return true
1416
hasproperty(layer, ) && return true
15-
return false
17+
return !isnothing(activation(layer))
1618
end
1719

1820
"""

0 commit comments

Comments
 (0)