Skip to content

Sequential

Yi Zhu edited this page May 14, 2021 · 4 revisions

Functionality

Sequential is a type of networks and it is very similar to the Sequential in Keras. It can be added with multiple layers and trained with an optimizer. Its variable type is a mutable constructor.

Usage

To create a new sequential model, a variable has to be initialized:

Sequential()

Squential uses its property add_layer to add layer. It autofills the proper size of input data (input_shape) automatically. However, you can still override them just by giving in the key arguments.

(model::Sequential, layer::Any; args...)

model: self reference

layer: a type of layer

args: parameters of the layer for initialization


If the model is used for prediction but not training, it requires to be initialized with an extra function before activated.

Sequential.initialize(model::Sequential, mini_batch::Int64)

model: self reference

mini_batch: the batch size of input data

Sequential.activate(model::Sequential, data::Array{Float32})

model: self reference

data: input data

return: output data


Sequential model can be saved and loaded by using the tools save_Sequential and load_Sequential.

save_Sequential(model::Sequential, path::String)

model: target sequential model

path: path

load_Sequential(path::String)

path: path of the target model

return: target model