Model with single input and single output.
More...
Model with single input and single output.
Also severs a Layer (inheriting SequentialLayer) for squeezing a sequence of layer into a single one.
| def keraflow.models.Sequential.__init__ |
( |
|
self, |
|
|
|
layers = [], |
|
|
|
kwargs |
|
) |
| |
- Parameters
-
| layers | a list of layer instance. |
| kwargs | see Layer.__init__. This is the common args for Layer. For Sequential, you could set name and trainable. |
| def keraflow.models.Sequential.compile |
( |
|
self, |
|
|
|
optimizer, |
|
|
|
loss, |
|
|
|
metrics = [] |
|
) |
| |
Configure the model and prepare inner utilized tensors.
- Parameters
-
| optimizer | str(name of optimizer class)/optimizer object. See keraflow.optimizers |
| loss | objective function/str(name of objective function). Objective for the output. See Objectives for a list of predefined objective functions. |
| metrics | objective function/str(name of objective function). Extra objective for the output. See Objectives for a list of predefined objective functions. Note that you could only pass one objective since Sequential has only one output. |
| def keraflow.models.Sequential.predict |
( |
|
self, |
|
|
|
x, |
|
|
|
batch_size = 32, |
|
|
|
train_mode = False |
|
) |
| |
Returns the output values given the input data.
- Parameters
-
| x | numpy array/list. Input data. |
| batch_size | int. The batch size to predict the testing data. Might cause memorage error if set too large. |
| train_mode | boolean. For debugging usage. Do not use this flag in your code. |
- Returns
- numpy array. Output value.