From 19830c71b1d821efd6c6bf2d775f526637968dcd Mon Sep 17 00:00:00 2001 From: Michael Abbott <32575566+mcabbott@users.noreply.github.com> Date: Wed, 25 Sep 2019 13:37:01 +0200 Subject: [PATCH] fix printing of SkipConnection --- src/layers/basic.jl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/layers/basic.jl b/src/layers/basic.jl index 67490472..66df1275 100644 --- a/src/layers/basic.jl +++ b/src/layers/basic.jl @@ -190,9 +190,9 @@ function (mo::Maxout)(input::AbstractArray) end """ - SkipConnection(layers...) + SkipConnection(layers, connection) -Creates a Skip Connection, which constitutes of a layer or Chain of consecutive layers +Creates a Skip Connection, which constitutes of a layer or `Chain` of consecutive layers and a shortcut connection linking the input to the block to the output through a user-supplied callable. @@ -200,7 +200,7 @@ output through a user-supplied callable. A 'ResNet'-type skip-connection with identity shortcut would simply be ```julia - SkipConnection(layer, (a,b) -> a + b) + SkipConnection(layer, +) ``` """ struct SkipConnection @@ -217,6 +217,7 @@ end function Base.show(io::IO, b::SkipConnection) print(io, "SkipConnection(") - join(io, b.layers, ", ") + b.layers isa Chain ? join(io, b.layers, ", ") : print(io, b.layers) + print(io, ",", b.connection) print(io, ")") end