Model Initialization
Compile
- class flexflow.core.flexflow_cffi.FFModel
- compile(optimizer=None, loss_type=None, metrics=None, comp_mode=None)
Configure the model for trainting. FlexFlow uses lazy initialization, so the actual creating of all operations (including creating and partitioning of weight, bias and output tensors) happen during compile.
- Parameters
optimizer (Optimizer) – optimizer instance.
loss_type (LossType) – Enum of LossType. Options are LOSS_CATEGORICAL_CROSSENTROPY, LOSS_SPARSE_CATEGORICAL_CROSSENTROPY, LOSS_MEAN_SQUARED_ERROR_AVG_REDUCE and LOSS_MEAN_SQUARED_ERROR_SUM_REDUCE.
metrics (MetricsType) – List of metrics to be evaluated by the model during training and testing. Each of this is a Enum of MetricsType. Options are METRICS_ACCURACY, METRICS_CATEGORICAL_CROSSENTROPY, METRICS_SPARSE_CATEGORICAL_CROSSENTROPY, METRICS_MEAN_SQUARED_ERROR, METRICS_ROOT_MEAN_SQUARED_ERROR, METRICS_MEAN_ABSOLUTE_ERROR
comp_mode (CompMode) – Enum of CompMode. Options are COMP_MODE_TRAINING, COMP_MODE_INFERENCE
- Returns
None – no returns.
Initialization
- class flexflow.core.flexflow_cffi.FFModel
- init_layers()
Initialize layers.
- Returns
None – no returns.