Sequence#
- class vulkpy.nn.Sequence#
Bases:
object
Sequential Model
All layers sequentially connceted.
Methods Summary
Methods Documentation
- predict(x: Array, y: Array | None = None) Array | Tuple[Array, Array] #
Predict Label/Target
- Parameters:
x (vulkpy.Array) – Features
y (vulkpy.Array, optional) – Labels/Targets.
- Returns:
pred_y (vulkpy.Array) – Predicted Labels/Targets
loss (vulkpy.Array) – Loss. Return only if
y
is specified.
- train(x: Array, y: Array) Tuple[Array, Array] #
Train model
- Parameters:
x (vulkpy.Array) – Features and Labels/Targets
y (vulkpy.Array) – Features and Labels/Targets
- Returns:
y (vulkpy.Array) – Predicted Labels/Targets
loss (vulkpy.Array) – Loss
- __init__(layers: Iterable[Module], loss: Loss)#
Initialize Sequence
- Parameters:
layers (iterable of vulkpy.nn.Module) – Layers to be called sequentially
loss (vulkpy.nn.Loss) – Loss layer