Skip to content

Commit 67a989a

Browse files
committed
resolving comments
1 parent 77109c3 commit 67a989a

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

FastTimeSeries/src/FastTimeSeries.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ using FilePathsBase
2727
using InlineTest
2828
using Statistics
2929
using UnicodePlots
30+
using Flux
3031

3132
# Blocks
3233
include("blocks/timeseriesrow.jl")

FastTimeSeries/src/models/InceptionTime.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
44
TBW
55
"""
6-
function InceptionModule(ni::Int, nf::Int, ks::Int = 40, bottleneck::Bool = true)
7-
ks = [ks ÷ (2^i) for i in range(0, stop = 2)]
8-
ks = [ks[i] % 2 == 0 ? ks[i] - 1 : ks[i] for i in range(1, stop = 3)] # ensure odd ks
6+
function InceptionModule(ni::Int, nf::Int, kernel_size::Int = 40, bottleneck::Bool = true)
7+
ks = [kernel_size ÷ (2^i) for i in 0:2]
8+
ks = [ks[i] % 2 == 0 ? ks[i] - 1 : ks[i] for i in 1:3] # ensure odd ks
99
bottleneck = ni > 1 ? bottleneck : false
1010

1111
bottleneck_block = bottleneck ? Conv1d(ni, nf, 1, bias = false) : identity
1212

1313
convs_layers =
14-
[Conv1d(bottleneck ? nf : ni, nf, ks[i], bias = false) for i in range(1, stop = 3)]
14+
[Conv1d(bottleneck ? nf : ni, nf, ks[i], bias = false) for i in 1:3]
1515

1616
convs = Chain(bottleneck_block, Parallel(hcat, convs_layers...))
1717

@@ -29,7 +29,7 @@ function InceptionBlock(ni::Int, nf::Int = 32, residual::Bool = true, depth::Int
2929
inception = []
3030
shortcut = []
3131

32-
for d in range(1, stop = depth)
32+
for d in 1:depth
3333
push!(inception, InceptionModule(d == 1 ? ni : nf * 4, nf))
3434
if residual && d % 3 == 0
3535
n_in = d == 3 ? ni : nf * 4
@@ -62,7 +62,6 @@ function InceptionBlock(ni::Int, nf::Int = 32, residual::Bool = true, depth::Int
6262
end
6363
end
6464
return Chain(blocks...)
65-
6665
end
6766

6867
changedims(X) = permutedims(X, (2, 1, 3))

FastTimeSeries/src/models/RNN.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ is passed through a dropout layer before a 'finalclassifier' block.
1919
- `dropout_rate`: Dropout probability for the dropout layer.
2020
"""
2121

22-
function RNNModel(recbackbone;
23-
outsize,
24-
recout,
25-
kwargs...)
22+
function RNNModel(recbackbone; outsize, recout)
2623
return RNNModel(recbackbone, Dense(recout, outsize))
2724
end
2825

FastTimeSeries/src/models/layers.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ layer to `LSTM(hiddensize, out)`. Takes the keyword argument `init` for the init
1818
of the layers.
1919
2020
"""
21-
function StackedLSTM(in::Int, out::Integer, hiddensize::Integer, layers::Integer;
21+
function StackedLSTM(c_in::Int, c_out::Integer, hiddensize::Integer, layers::Integer;
2222
init=Flux.glorot_uniform)
2323
if layers == 1
24-
return Chain(LSTM(in, out; init=init))
24+
return Chain(LSTM(c_in, c_out; init=init))
2525
elseif layers == 2
26-
return Chain(LSTM(in, hiddensize; init=init),
27-
LSTM(hiddensize, out; init=init))
26+
return Chain(LSTM(c_in, hiddensize; init=init),
27+
LSTM(hiddensize, c_out; init=init))
2828
else
29-
chain_vec = [LSTM(in, hiddensize; init=init)]
29+
chain_vec = [LSTM(c_in, hiddensize; init=init)]
3030
for i = 1:layers - 2
3131
push!(chain_vec, LSTM(hiddensize, hiddensize; init=init))
3232
end
33-
return Chain(chain_vec..., LSTM(hiddensize, out; init=init))
33+
return Chain(chain_vec..., LSTM(hiddensize, c_out; init=init))
3434
end
3535
end
3636

0 commit comments

Comments
 (0)