Model¶
-
class
baikal.Model(inputs, outputs, targets=None, name=None)¶ Bases:
baikal._core.step.StepA Model is a network (more precisely, a directed acyclic graph) of Steps, and it is defined from the input/output specification of the pipeline. Models have fit and predict routines that, together with graph-based engine, allow the automatic (feed-forward) computation of each of the pipeline steps when fed with data.
- Parameters
inputs – Inputs to the model.
outputs – Outputs of the model.
targets – Targets of the model.
name – Name of the model (optional). If no name is passed, a name will be automatically generated.
Methods
fit(X[, y])Trains the model on the given input and target data.
get_compute_func_at(port)Get compute function at the specified port.
get_data_placeholder(name)Get a data placeholder (graph half-edge) in the model by name.
get_fit_compute_func_at(port)Get fit-compute function at the specified port.
get_inputs_at(port)Get inputs at the specified port.
get_outputs_at(port)Get outputs at the specified port.
get_params([deep])Get the parameters of the model.
get_step(name)Get a step (graph node) in the model by name.
get_targets_at(port)Get targets at the specified port.
get_trainable_at(port)Get trainable flag at the specified port.
predict(X[, output_names])Predict by applying the model on the given input data.
set_compute_func_at(port, value)Set compute function at the specified port.
set_fit_compute_func_at(port, value)Set fit-compute function at the specified port.
set_params(**params)Set the parameters of the model.
set_trainable_at(port, value)Set trainable flag at the specified port.
__call__(inputs[, targets, compute_func, …])Call the step on input(s) (from previous steps) and generates the output(s) to be used in further steps.
Attributes
compute_funcGet the compute function of the step.
fit_compute_funcGet the fit-compute function of the step.
graphGet the graph associated to the model.
inputsGet the inputs of the step.
n_outputsGet the number of outputs the step produces.
nameGet the name of the step.
outputsGet the outputs of the step.
targetsGet the targets of the step.
trainableGet trainable flag of the step.