From 4685d2e6720c6b3e6877cd24b82dbb12054d9923 Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Mon, 5 Jun 2017 15:47:26 +0100 Subject: [PATCH] strip down non-obvious exports --- src/data.jl | 4 ---- src/layers/activation.jl | 2 +- src/layers/cost.jl | 2 -- src/layers/shims.jl | 2 +- src/model.jl | 4 ---- src/utils.jl | 2 -- 6 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/data.jl b/src/data.jl index 48df0c10..1a146eb7 100644 --- a/src/data.jl +++ b/src/data.jl @@ -1,5 +1,3 @@ -export onehot, onecold, chunk, partition, batches, sequences - """ onehot('b', ['a', 'b', 'c', 'd']) => [false, true, false, false] @@ -27,8 +25,6 @@ onecold(y::AbstractMatrix, l...) = using Iterators import Iterators: Partition, partition -export partition - Base.length(l::Partition) = length(l.xs) ÷ l.step _partition(r::UnitRange, step::Integer) = (step*(i-1)+1:step*i for i in 1:(r.stop÷step)) diff --git a/src/layers/activation.jl b/src/layers/activation.jl index 26ab89f6..9955d1f4 100644 --- a/src/layers/activation.jl +++ b/src/layers/activation.jl @@ -1,4 +1,4 @@ -export σ, relu, softmax, flatten +export σ, relu, softmax # Sigmoid σ(x) = 1 ./ (1 + exp.(-x)) diff --git a/src/layers/cost.jl b/src/layers/cost.jl index 57727b8d..009e37cd 100644 --- a/src/layers/cost.jl +++ b/src/layers/cost.jl @@ -1,5 +1,3 @@ -export mse, logloss - mse(ŷ, y) = sumabs2(ŷ .- y)/2 back!(::typeof(mse), Δ, ŷ, y) = Δ .* (ŷ .- y) diff --git a/src/layers/shims.jl b/src/layers/shims.jl index 46a31ac0..877ac6c5 100644 --- a/src/layers/shims.jl +++ b/src/layers/shims.jl @@ -1,4 +1,4 @@ -export Conv2D, MaxPool, AvgPool, Reshape +export Conv2D struct Conv2D <: Model filter::Param{Array{Float64,4}} # [height, width, inchans, outchans] diff --git a/src/model.jl b/src/model.jl index c2f27a85..ffb74689 100644 --- a/src/model.jl +++ b/src/model.jl @@ -1,5 +1,3 @@ -export Model, back!, update!, param - # Basic model API """ @@ -93,8 +91,6 @@ Base.copy!(p::Param, xs) = copy!(p.x, xs) # Anonymous models -export Capacitor - struct Capacitor <: Model graph::IVertex{Any} end diff --git a/src/utils.jl b/src/utils.jl index 8e5f2efd..d5ae18e8 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -1,5 +1,3 @@ -export AArray, unsqueeze - call(f, xs...) = f(xs...) # Arrays