Model Training and Testing
Fit
- class flexflow.core.flexflow_cffi.FFModel
- fit(x=None, y=None, batch_size=None, epochs=1)
Trains the model for a fixed number of epochs (iterations on a dataset).
- Parameters
x (Dataloader) – Input data. It can be a Dataloader instance or a list of Dataloader instances.
y (Dataloader) – Target data (label). It can be a Dataloader instance or a list of Dataloader instances.
batch_size (int) – Number of samples per gradient update. It must be identical with
-b
or--batch-size
from the command line.epochs (int) – Number of epochs to train the model. An epoch is an iteration over the entire
x
andy
data provided. The default value is 1.
- Returns
None – no returns.
Evaluate
- class flexflow.core.flexflow_cffi.FFModel
- eval(x=None, y=None, batch_size=None)
Returns the loss value & metrics values for the model in test mode.
- Parameters
x (Dataloader) – Input data. It can be a Dataloader instance or a list of Dataloader instances.
y (Dataloader) – Target data (label). It can be a Dataloader instance or a list of Dataloader instances.
batch_size (int) – Number of samples per gradient update. It must be identical with
-b
or--batch-size
from the command line.epochs (int) – Number of epochs to train the model. An epoch is an iteration over the entire
x
andy
data provided. The default value is 1.
- Returns
None – no returns.
Customized Training
- class flexflow.core.flexflow_cffi.FFModel
- backward(seq_length=None)
Backward propagation of all layers.
- Returns
None – no returns.
- compute_metrics()
Compute performance metrics.
- Returns
None – no returns.
- forward(seq_length=None)
Forward propagation of all layers.
- Returns
None – no returns.
- reset_metrics()
Reset performance metrics.
- Returns
None – no returns.
- update()
Update weights and biases of all layers.
- Returns
None – no returns.
- zero_gradients()
Empty the gradients of all layers.
- Returns
None – no returns.