module Ses

using MKL

using BSON
using DataFrames, DataStructures, Dates, Distributions
using Flux: @epochs, @forward, @functor
using Flux: _isactive,
            Chain,
            gradient,
            loadparams!,
            ones,
            params, 
            Recur,
            sigmoid, SkipConnection, softplus, softmax, stop,
            throttle
using Flux.Losses: mse
using Flux.Optimise: AbstractOptimiser, ADAM, update!
using InteractiveUtils
using Logging
using Random
using Serialization
using SpecialFunctions: loggamma
using TensorBoardLogger: log_value, log_vector,
                         set_step!,
                         TBLogger, tb_overwrite, TensorBoardLogger
using Zygote: Buffer, Params, pullback


import Flux: reset!, trainable, update!

export AbstractSesCell, AbstractSesScaler, alpha,
       DailyOp,
       fit!,
       init_log_file,
       LevelTrend, LinearTrend, load_model, LogLinearTrend, log_appendix, logging, loop,
       Mapped, MonthlyOp,
       restart!,
       save_model, SeasonalOp, SelectIndex, SelectRange, SesMap, SesNbOperator, SesOperator, smooth,
       theta, train,
       update!,
       WeeklyOp, YearlyOp



include("src/utils.jl");
include("src/metrics.jl");
include("src/nnlibs.jl");



include("src/cells/base.jl");
include("src/seasonal/base.jl");
include("src/map/base.jl");
include("src/ssm/base.jl");



include("src/functor.jl");
include("src/logging.jl");
include("src/train.jl");



end