From 8869f1f953857f3475905b2f7a59e79be536ca57 Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Fri, 18 Aug 2017 00:46:53 +0100 Subject: [PATCH] these are now useless --- src/Flux.jl | 1 - src/layers/shims.jl | 37 ------------------------------------- 2 files changed, 38 deletions(-) delete mode 100644 src/layers/shims.jl diff --git a/src/Flux.jl b/src/Flux.jl index 3d50efc1..ac3b86d3 100644 --- a/src/Flux.jl +++ b/src/Flux.jl @@ -36,7 +36,6 @@ include("layers/affine.jl") include("layers/activation.jl") include("layers/cost.jl") include("layers/recurrent.jl") -include("layers/shims.jl") include("data.jl") include("training.jl") diff --git a/src/layers/shims.jl b/src/layers/shims.jl deleted file mode 100644 index b1d47fcd..00000000 --- a/src/layers/shims.jl +++ /dev/null @@ -1,37 +0,0 @@ -struct Conv2D - filter::Param{Array{Float64,4}} # [height, width, inchans, outchans] - stride::Dims{2} -end - -Conv2D(size; in = 1, out = 1, stride = (1,1), init = initn) = - Conv2D(param(initn(size..., in, out)), stride) - -infer(c::Conv2D, in::Dims{4}) = - (in[1], map(i -> (in[i+1]-size(c.filter,i))÷c.stride[i]+1, (1,2))..., size(c.filter, 4)) - -# TODO: many of these should just be functions - -for Pool in :[MaxPool, AvgPool].args - @eval begin - struct $Pool - size::Dims{2} - stride::Dims{2} - end - - $Pool(size; stride = (1,1)) = - $Pool(size, stride) - - infer(c::$Pool, in::Dims{4}) = - (in[1], map(i -> (in[i+1]-c.size[i])÷c.stride[i]+1, (1,2))..., in[4]) - - shape(c::$Pool) = nothing - end -end - -struct Reshape{N} - dims::Dims{N} -end - -Reshape(dims::Integer...) = Reshape(dims) - -shape(r::Reshape, ::Void) = r.dims