Skip to content

Commit 18f2eb3

Browse files
committed
v1
1 parent 66675f7 commit 18f2eb3

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

FastTimeSeries/src/models/InceptionTime.jl

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
"""
2-
InceptionModule(ni::Int, nf::Int, ks::Int = 40, bottleneck::Bool = true)
3-
4-
TBW
5-
"""
61
function InceptionModule(ni::Int, nf::Int, ks::Int = 40, bottleneck::Bool = true)
72
ks = [ks ÷ (2^i) for i in range(0, stop = 2)]
83
ks = [ks[i] % 2 == 0 ? ks[i] - 1 : ks[i] for i in range(1, stop = 3)] # ensure odd ks
@@ -40,7 +35,8 @@ function InceptionBlock(ni::Int, nf::Int = 32, residual::Bool = true, depth::Int
4035
if (residual && d % 3 == 2)
4136
n_in = d == 2 ? ni : nf * 4
4237
n_out = nf * 4
43-
push!(shortcut, Chain(Conv1d(n_in, n_out, 1), BatchNorm(nf)))
38+
block = n_in == n_out ? BatchNorm(n_out) : Chain(Conv1d(n_in, n_out, 1), BatchNorm(n_out))
39+
push!(shortcut, block)
4440
end
4541
end
4642
return InceptionBlock(residual, depth, inception, shortcut)
@@ -53,8 +49,9 @@ function (m::InceptionBlock)(x)
5349
res = x
5450
for d in range(1, stop = m.depth)
5551
x = m.inception[d](x)
56-
if m.residual && d%3 == 0
57-
res = x = Flux.relu(x + m.shortcut[d÷3](res))
52+
if m.residual && d % 3 == 0
53+
x = Flux.relu(x + m.shortcut[d÷3](res))
54+
res = x
5855
end
5956
end
6057
return x

FastTimeSeries/src/recipes.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ const RECIPES = Dict{String,Vector{Datasets.DatasetRecipe}}(
5858
"natops" => [
5959
TimeSeriesDatasetRecipe(train_file="NATOPS_TEST.ts", test_file="NATOPS_TRAIN.ts")
6060
],
61-
#! TODO.
6261
"appliances_energy" => [
6362
TimeSeriesDatasetRecipe(train_file="AppliancesEnergy_TRAIN.ts", test_file="AppliancesEnergy_TEST.ts", regression = true)
6463
]

FastTimeSeries/src/tasks/regression.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function TSRegression(blocks::Tuple{<:TimeSeriesRow, <:Continuous}, data)
1010
(
1111
setup(TSPreprocessing, blocks[1], data[1].table),
1212
),
13+
ŷblock = blocks[2]
1314
)
1415
end
1516

0 commit comments

Comments
 (0)